0% found this document useful (0 votes)
41 views6 pages

Appendix A

OpenFOAM tutorial one

Uploaded by

K-21ME070
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views6 pages

Appendix A

OpenFOAM tutorial one

Uploaded by

K-21ME070
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Appendix A

Linux Commands

6th edition, April 2023

This offering is not approved or endorsed by ESI® Group, ESI-OpenCFD® or the OpenFOAM®
Foundation, the producer of the OpenFOAM® software and owner of the OpenFOAM® trademark.
OpenFOAM® Basic Training

Appendix A

Editorial board: Contributors:


 Bahram Haddadi  Christian Jordan
 Christian Jordan  Bahram Haddadi
 Michael Harasek  Clemens Gößnitzer
Compatibility:  Jozsef Nagy
 Unix (Linux, Alpha Unix …)  Vikram Natarajan
 Sylvia Zibuschka
Cover picture from:
 Yitong Chen
 Bahram Haddadi

Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)


This is a human-readable summary of the Legal Code (the full license).
Disclaimer
You are free:
 to Share — to copy, distribute and transmit the work
 to Remix — to adapt the work
Under the following conditions:
 Attribution — you must attribute the work in the manner specified by the author or
licensor (but not in any way that suggests that, they endorse you or your use of the
work).
 Noncommercial — you may not use this work for commercial purposes.
 Share Alike — if you alter, transform, or build upon this work, you may distribute the
resulting work only under the same or similar license to this one.
With the understanding that:
 Waiver — any of the above conditions can be waived if you get permission from the
copyright holder.
 Public Domain — where the work or any of its elements is in the public domain under
applicable law, that status is in no way affected by the license.
 Other Rights — In no way are any of the following rights affected by the license:
 Your fair dealing or fair use rights, or other applicable copyright exceptions and
limitations;
 The author's moral rights;
 Rights other persons may have either in the work itself or in how the work is used,
such as publicity or privacy rights.
 Notice — for any reuse or distribution, you must make clear to others the license
terms of this work. The best way to do this is with a link to this web page.

ISBN 978-3-903337-02-2
Publisher: chemical-engineering.at
Available from: www.fluiddynamics.at
OpenFOAM® Basic Training

Appendix A

cat, more, less File viewer with pure read function - in order of ease of operation. In less with
pagedown/pageup you can navigate within the file, with / and ? can look for
strings, q can be used for closing less. cat is back for universally available on
Unix.

cd, cd .. Changing the directory, cd .. goes one directory up and cd ~ moves to home
directory. Important to note is the space between cd and .. as opposed to DOS!

cp, cp -r Copying files or entire directory trees (with -r option). Caution: There is no
warning or prompt when overwriting existing files! The important thing is that a
target has to be always given, at least one . which means, copy to the current
directory.

ctrl+r Reverse search, for searching an already typed command in a terminal window.

du, du -s, Calculates the amount of space consumed in a directory. For safety reasons you
should use the -k option (output in kilobytes), since some systems provide the
du -k
space in blocks that include only 512 bytes ...

exit Closing connection (terminal window).

gedit Text editor with graphical user interface. When working with gedit some
temporary files (originalFileName~) are created, they can be deleted after
saving.

grep Search command for plain-text data sets for lines matching a regular expression.

gzip, gunzip Compression/decompression program for individual files (as opposed to


zip/unzip, this can also work on directories or file lists). The great advantage of
gzip: Fluent® and OpenFOAM® are able to read and write gz files directly, which
saves about 30-90% space.

kill, kill -9 Stopping processes. For this the process ID is required, which can be found with
top or ps. The Exit is irrevocable course - but you cannot shoot processes, if
you are not the "owner".

ls, ls –la Lists the contents of a directory, with option -la also hidden files are displayed,
as well as the file size and characteristics.

mc Program that enables navigation in the text window, esc-keys, may be


necessary: mc -c, for navigating through mc use function keys or esc+[number]
combination, e.g. F9 or esc+9 for moving to the menus at the top.
OpenFOAM® Basic Training

Appendix A

mkdir Creates a new directory.

mv Moving or renaming files and directories. Caution: There is no prompt when


overwriting existing files!

Nano, pico The command to run the nano text editor, a terminal based text editor.

passwd The command to change the login password.

| It is known as pipe and is used for merging two commands, redirecting one
command as input to another, e.g. less|grep searches a specified word in the
output of file opened with less.

ps, ps –A Lists all the processes that were started in the respective command window with
the options are all running processes on the system display.
ps waux

pwd Shows the current working directory.

rm, CAUTION: Deletes files. The option -r will also remove directories and files recursively and
rm -fr delete directories, f (force) prevents any further inquiry. - Incorrectly applied, this
command can lead to irreversible loss of all (private) data. There is no undelete
or undo!

rmdir Deletes an empty directory.

scp The copy command over the network - as secure FTP replacement. Also
dominates the -r (recursive) option. Usage: scp source file destination file with
source and the destination format can be USERNAME@
COMPUTER.DOMAIN:PATH/TO/FILE. Source or target can of course also be
created locally, then (your) user name and computer are not required.

ssh Telnet replacement with encryption. On Windows, for example, implemented


with putty.

tail, tail -f File viewer, the default outputs the last 10 lines of a file. With option -n XX can
spend the last XX lines, with the -f option, the command is running from those
lines, which are attached to a file. The command is therefore perfect for watching
log files.
OpenFOAM® Basic Training

Appendix A

top Displays a constantly updated list of all running processes, with process ID,
memory and CPU usage. For processes of one user top [username] should be
used, and for quitting q or ctrl+c should be applied.

vi, vim File editor. For forward searching use /, for backward searching use ?. For
exiting esc+:x. nano or pico are recommended for beginners, which are easier
to handle.
OpenFOAM® Basic Training

Appendix A

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy