What is Linux ?
Linux is an operating system created by Finnish american software principal engineer Linus Benedict Torvalds. It is an open source software with its first release in the year 1991. Official website of linux is https://www.linuxfoundation.org.
Today, linux operating system is used in most of the IT companies.
pwd stands for Present Working Directory. It is a built-in Linux command which prints the absolute path from the root.
pwd -p : prints the path without symbolic link in it.
pwd -L : prints the path with symbolic link in it.
How to compress the files and directories in Linux?
tar linux command creates a collection of files and compress and also uncompress/decompress them.
tar -cvf collection.tar test ( -c: create, -f: files and -v: verbose )
It will create a tar file named collection.tar which contains contents of folder test.
tar -czvf compress.tar.gz test ( -z: compress )
test folder contents will be collected and compressed.
tar -xvf archive.tar /home/test ( -x: extract )
it will the extract the conents from archive.tar file and places them in /home/test/ location.
tar -xzvf archive.tar.gz /home/unzipped
It will first unzip the contents and then extracts it and places in /home/unzipped/ area.
How to search for strings in linux?
fgrep, fixed string grep, same as grep -f.
frep uses a special algorithm during its manipulation.
fgrep -f search.txt sourcefile.txt
fgrep -f search.txt sourcefile.txt
Extracts the content from sourcefile.txt that matches with the search pattern
grep -f search.txt sourcefile.txt
It also does the same operation but it is slower compaired to fgrep.
grep -f search.txt sourcefile.txt
It also does the same operation but it is slower compaired to fgrep.
How to check the Linux jobs running in the background?
jobs prints all the jobs running.
jobs -l, prints the process-ID and job-ID along with the jobs.
jobs -p, prints the jobs with process-ID only.
Linux exit command is used for exiting from the job, shell, process and also the terminal.