Difference between revisions of "Unix"

From Rizzo_Lab
Jump to: navigation, search
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
A great Unix tutorial is here http://www.ee.surrey.ac.uk/Teaching/Unix/
 
A great Unix tutorial is here http://www.ee.surrey.ac.uk/Teaching/Unix/
  
Linux Basics https://help.ubuntu.com/6.06/ubuntu/desktopguide/C/linux-basics.html
 
  
Convert one image to another:
+
==Looking at your environment==
 +
pwd            print the current location
 +
ls            list the contents of the current location
  
  convert -density 600 figs/fig14.eps figs/fig14.png
+
==Moving around==
 +
  mkdir          create a new directory
 +
rmdir          remove a diretory
 +
cd            go to a location by specifying the directory
  
==Resources==
+
==Modifying your environment with files==
[[Image:Linux-101-Hacks.pdf]]
+
vim            create a new file or edit an existing file
 +
rm            remove a file/directory
 +
cp            copy a file/directory
 +
mv            move a file/directory or change the name of a file/directory
 +
 
 +
==More commands==
 +
man            instructions for using commands
 +
cat            print contents of a file
 +
more          view contents of a file
 +
diff          show the difference between two files
 +
grep          search within a file for specific text
 +
chmod          change permission of a file or directory
 +
whoami        shows your username
 +
clear          clear the screen
 +
ssh            log on to a different computer
 +
scp            copy files to/from a different computer
 +
tcsh          execute a C shell (tcsh) script
 +
bash          execute a Bourne-Again Shell (bash) script
 +
ps -fu        see current processing commands
 +
logout/exit    logout of a computer
 +
 
 +
==Other things to know==
 +
./            shortcut for 'current directory'
 +
../            shortcut for 'parent directory'
 +
~/            shortcut for 'home directory'
 +
>              print something to a file
 +
>>            append something to a file
 +
*              shortcut for 'any strings of characters'
 +
|              chain commands
 +
&              run stuff in the background
 +
\              escape a character
 +
 
 +
==Keyboard shortcuts==
 +
<tab>          auto-complete
 +
<up arrow>    see command history
 +
<Ctrl+c>      interrupt a process
 +
<Ctrl+d>      logout
 +
 
 +
==Queuing commands for SLURM (Seawulf only)==
 +
sbatch            submit a job to the queue
 +
squeue            check on jobs in the queue
 +
scancel          delete a job from the queue

Latest revision as of 21:28, 22 January 2020

A great Unix tutorial is here http://www.ee.surrey.ac.uk/Teaching/Unix/


Looking at your environment

pwd            print the current location
ls             list the contents of the current location

Moving around

mkdir          create a new directory
rmdir          remove a diretory
cd             go to a location by specifying the directory

Modifying your environment with files

vim            create a new file or edit an existing file
rm             remove a file/directory
cp             copy a file/directory
mv             move a file/directory or change the name of a file/directory

More commands

man            instructions for using commands
cat            print contents of a file
more           view contents of a file
diff           show the difference between two files
grep           search within a file for specific text
chmod          change permission of a file or directory
whoami         shows your username
clear          clear the screen
ssh            log on to a different computer
scp            copy files to/from a different computer
tcsh           execute a C shell (tcsh) script
bash           execute a Bourne-Again Shell (bash) script
ps -fu         see current processing commands
logout/exit    logout of a computer

Other things to know

./             shortcut for 'current directory'
../            shortcut for 'parent directory'
~/             shortcut for 'home directory'
>              print something to a file
>>             append something to a file
*              shortcut for 'any strings of characters'
|              chain commands
&              run stuff in the background
\              escape a character

Keyboard shortcuts

<tab>          auto-complete
<up arrow>     see command history
<Ctrl+c>       interrupt a process
<Ctrl+d>       logout

Queuing commands for SLURM (Seawulf only)

sbatch            submit a job to the queue
squeue            check on jobs in the queue
scancel           delete a job from the queue