
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

ls List directories and files here ls dir List directories and files in a directory ls -a List all files including hidden files
ls -lh List including more data in readable format pwd Return path to working directory cd dir Change directory cd .. Go to parent directory cd / Go to root directory cd ~ Go to home directory cd Go to home directory touch file Create en empty file cp file1 file2 Copy file1 to file
cp -r dir1 dir
Copy dir1 to dir2 including subdirectories rm file Remove a file rm -r dir Remove a directory and its files mv dir1 dir2 Move or renames a file mkdir dir Make a directory rmdir dir Remove a directory locate file Search a file
man command Show command usage top Show process activity continuously top -n1 Show process activity once command > file Save STDOUT in a file command >> file Append STDOUT in a file [Tab] Autocomplete or hints icc main.c Compile C code icpc main.cpp Compile C++ code ifort main.f Compile Fortran code
cat file1 file2 > file3 Merge files 1 and 2 into file head file Print first lines from a file head -n 5 file Print first 5 lines from a file tail file Print last lines from a file tail -n 5 file Print last 5 lines from a file less file View a file less -N file View file with line numbers less -S file View file, wrap long lines grep ‘pattern’ file Print lines matching a pattern grep -c ‘pattern’ file Count lines matching a pattern
cut -f 1,3 file Retrieve data from 1,3 columns in a tab-delimited file sort file Sort lines from a file sort -u file Sort and return unique lines uniq -c file Filter adjacent repeated lines wc file Count lines, words and bytes
tar -cf file.tar dir Group files tar -xf file.tar Ungroup files tar -zcf file.tar.gz dir Group and compress files tar -zxf file.tar.gz Extract and ungroup files
wget url Download a file ssh user@server Connect to a server scp -r local_dir user@server:remote_dir
Copy file from local to remote computer scp -r user@server:remote_dir local_dir
Copy file from remote to local computer