Linux Commands and syntax Flashcards
Command format
command options arguments
/
absolute path
pwd
print working directory
~
shortcut to absolute path of home directory
cd
change directory
ls
list directory contents
ls -l
produces a detailed long format list
ls -lrth
displays files in chronological order rather than alphabetical
t
time
r
reverse
h
human-readable
du-h
disk usage reveals the size of the current directory
mkdir
make directory in current directory
!$
represents most recently used argument (last argument of last command)
gedit and nano
text editors that can be used as commands to open or create a file in the editors
xyz
file format that represents molecules: number of atoms, comment line, types of atoms and their positions in angstroms
cp
copy (and rename)
mv
move (and rename)
rm
remove
../
parent directory of current directory
cat
prints the contents of the file
less
allows paging through contents (of a large file) using the space bar, end with q
head or tail -
retrieves the first or last (given number) of lines of a file
tabs
predict and auto-type the rest of a directory or file name
*
wildcard that can represent the beginning or end of any filename
alias
defines a short number of characters to represent a long command
history
views a history of previously typed commands
!(number)
displays the numbered command in the history
file types
- file
d directory
l link
user types
u user
g group associated with the file
o other users
permissions
r read
w write
x execute
chmod
changes permissions e.g. chmod u+x filename
|
a pipe allowing the output of the preceding command to be the input of the following command
< and >
operators used to read input from or send output to files e.g. ls -R ~ > filename
R
recursive
;
separates commands to allow them to be run on one line
grep
allows looking through the contents of a file for a given string
e.g. -i ‘look for this’ filename
-i
ignore case of expression
ssh
allows access to other computers
e.g. nameofcomputer
signing in with different username
e.g. ssh username@host
hamilton
the Durham University computational research computer, possessing over 15000 processors; full name to log in: username@hamilton.dur.ac.uk
-Y
forwards graphical output to the screen when used with ssh
PuTTY
provides command line execution for Windows
:
separates the name of the remote computer and the path for the file to go to
copy file from home computer to computer on mira
scp filename.txt username@mira.dur.ac.uk:~/
copy file from computer on mira to home computer
scp username@mira.dur.ac.uk:~/filename.txt
PATH
variable which tells the shell where to search for programs
setnev
sets the value of environment variables
echo
displays contents of a variable
man
displays the manual pages for a given command, navigable by arrow kwys
man
displays the manual pages for a given command, navigable by arrow keys and quitable with q
man
displays the manual pages for a given command, navigable by arrow keys and quittable with q
apropos
displays a list of commands for a given task
viewer
selects commands that can be used for visiting files in different formats
molden
used for viewing files, end by clicking a skull or typing Ctrl-c in the terminal
babel/obabel
allows switching between file formats
e.g. obabel -i<input-type> input-name -o<output-type></output-type></input-type>
jmol
a program that is able to view molecular structures and read xyz files