linux commandsEstimated reading time: 2 minutes
make directory .
mkdir [option] directory_name(s)
mkdir customer # with permission flag mkdir -m 777 customer # create directory inside parent mkdir -p company/customer
make a empty file with
cd means change directory .
cd [option] [directory]
# current directory cd . # parents of current directory cd .. # home directory cd ~ # change directory with forwars slash cd /usr/sbin
pwd is present work directory
clear command removes all previous commands.
head commands display few lines from first of file
tail commands display few lines from last of file
lessdisplay all content of file without scrolling
cp command is copy
cp [options] name new_name
cp <option> from to(with rename)
cp file1 /home/john/file1
mv = move
mv [options] source target
mv file3 dir1/file3
remove empty directories .
rmdir [option] directory_names
rmdir dir1 dir2 # parents rmdir -p dir1/dir/dir
remove commands use for delete files and directory.
rm [options] [-r directories] filenames
rm file1 #recursively rm -r file1 #force rm -f file1 #recursively force rm -rf file1
locate is faster , database system.
- install locate
sudo apt-get update sudo apt-get install mlocate sudo updatedb
locate [options] name(s)
# currently log in user who #log in user whoami
every user has unique user id (uid) that is greather than 1000.linux, os, cli