Basic Commands Flashcards
To learn basic unix commands
list files and directories
ls
list all files and directories
ls -a
make a directory
mkdir
change to named directory
cd directory_name
change to home-directory
cd or cd ~
change to parent directory
cd ..
display the path of the current directory
pwd
stands for: Print Working Directory
copy file1 and call it file2
cp file1 file2
move or rename file1 to file2
mv file1 file2
remove a file
rm filename
remove a directory
rmdir directoryname
display a file
cat filename
display a file a page at a time
less filename
displat the first few lines of a file
head filename
display the last few lines of a file
tail filename
search a file for keywords
grep ‘keyword’ filename
count number of lines/words/characters in file
wc filename
redirect standard output to a file
command > file
append standard output to a file
command»_space; file
redirect standard input from a file
command < file
pipe the output of command1 to the input of command2
command1 | command2
concatenate file1 and file2 to file0
cat file1 file2 > file0
sort data
sort
list users currently logged in
who