Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 1.64 KB

File metadata and controls

30 lines (23 loc) · 1.64 KB

Basic Common Linux Commands

Linux is amazingly powerful. As with most powerful tools there is a learning curve, but it is actually a fairly mild one. In order to use CARC supercomputers you will need to learn a few basic commands to read, write, copy and remove files, create, copy and remove directories, and understand the file tree and where you are in it. The following is a reference sheet for the most basic commands, but again, Linux is extremely powerful and learning details beyond the basics will allow you to be more a efficient, happy and productive computational scientist.

Conventions

Convention Meaning
. Current directory
.. One directory above current directory
~ Your home directory
<blah> In this document, things wrapped in <> indicate fields that need to be replaced by user. Do not include the <> brackets.

Dealing with files and directories

Command Description
ls List files in the current directory
ls -l Formatted list with more detail
cd <dir> Change directory to dir
pwd Print the current working directory
rm <file> Remove a file
rm -r <dir> Remove recusively. Removes a directory and everything within it
cp <file1> <file2> Copy file1 to file2
cp -r <dir1> <dir2> Copy a directory to another directory
mv <file1> <file2> Move file1 to file2. If file2 is a directory, file1 will be moved into file2
mkdir <directory> Make direcotry
rmdir <directory> Remove directory