You are on page 1of 1

Linux terminal syntax

command Description
pwd Show parent working directory and pathways.

cd /name/name Change working directory


.. Go back one folder

ls List files and directories


-l Long form
-la List all files

Less View text files


Page up or b: Scroll back one page
Page down or space: Scroll forward one page
G: go to end of text file
1G: Go to beginning of text file
/character: Search for character
n: repeat previous search
h: Display a complete list less commands and options
q: Quit

cp file1 file2 Copy content of file1 into file2


cp -i file1 file2 If file2 exists the user is prompted before it is overwritten
cp file1 dir1 Copy content of file1 into a file1 in directory dir1
cp -R dir1 dir2 Copy content of directory dir1 into directory dir2

mv file1 file2 If file2 do not exists then file1 is rename file 2. If it exists then the
content of file 2 is overwritten by content in file 1
mv -i file1 file2 If file2 do exists the user is prompted before it is overwritten
mv file1 file2 dir1 Move file1 and file2 to directory dir1
mv dir1 dir2 Move dir1 into dir2

rm file1 file2 Remove files 1 and 2


rm -r dir1 dir2 Remove directories 1 and 2 along with all content
rm -i Ask first

mkdir Create directories

type command Display the kind of command


help command Description of command

http://linuxcommand.org/lc3_lts0070.php

You might also like