basic linux commands list code example

Example 1: linux basic commads

ls - list everything in current dirrectory
cd directoryname - change directory to given directory
cp directorynameofcopied directorynamewheretocopy - copes a file or folder
mv directoryoffiletobemoved directrynameofdestinationtomove - moves a file
pwd - print current location
touch filename - create a file
cat > filename - createa a file name and write into it
| - pipe command, lets you combine commands

Example 2: linux commands list

Directories can be created on a Linux operating system using the following command:

mkdir directoryname

Example 3: linux commands list

The 'mv' (move) command can also be used for renaming directories. Use the below-given format:
mv directoryname newdirectoryname