Linux Commands
Linux is free & opensource, community based project and multiuser based os.
pwd //present working director
cal // calender
whoami //user of the machine
ls //to get the list of files
touch file.txt //to create a file
vi file.txt //to go edit mode and after to exit press esc and :wq to save and quit
cat file.txt //to displat the content in file
cat " hi linux" > file.txt// to ceat a file and keep data in the file
cat file.txt file2.txt > file3.txt // it stores the two files data into third fiel
echo "linux"//to display
mkdir directoryname//to create directory
ls -l //it shows all the files with permisions,date and time
ls -t//it list the files based on the time
ls -lr//it shows in reverse order
ls -ltr
rm filename //to remove file
rmdir directoryname//to remove the directory
clear
cp file.txt file2.txt //to copies the files from file.txt
mv file.txt name.txt//it renames the file
cmp f1.txt f2.txt//it display on the first difference
diff f1.txt f2.txt//it displays the all the differnce
grep "word" file.txt//it searches the word in the file.txt
grep -i "word" file.txt //-i means the case-sentisive
grep -c "word" file.txt// it count the word present in the file
grep "word" *//* represents the all the files to search
grep -R "word" * //it searches in the directory and sub .
chomd //is use for file permissions
rwxrwxrwx // r-read w-write x-execute
chomd u+r file.txt//to give the read permission for user and -r means to temove the permission
chomd g+x file.txt// to give the excute permmission to group
chmod o+w file.txt // to give write permission to the others
locate filename // to locate the file in the pre-built database
locate -c filename // count the files
locate -c * .txt // to see all the tst file sin the db
locate -S // to see the db
find /home -name filename // to find the files in the home directory
find /tmp -type f/d -empty// to find the empty files/directories under the tmp
find -type f -perm 777 -print// to print the files whoose have the these permissions
sudo adduser username// to the user in the linuxmachine
sudo su // go into the user
sudo userdel username
cat /etc/groups//to chcek the groups
sudo groupadd name// to create a group
sudo groupdel name// to delete the group
sudo usermod -aG groupname username// to add user in group
sudo gpasswd -d username groupname// to delete the user from the group
awk-It is a a powerful text processing and pattern matching
awk options 'pattern { action }' filename
chown //is use dto chaneg the ownership of the file
top //command is a real-time system monitoring tool that displays information about running processes, CPU usage, memory usage, load averages, and more.
free //free command displays information about system memory (RAM) and swap usage. It shows the total amount of free and used physical and swap memory in the system.
ps-aux// -a is for shows all the processors -u s to describe about it -x is for include processes that are not attached to a terminal
cron job in Linux refers to a task or command that is scheduled to run automatically at specified intervals using the cron scheduler