







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








An operating system is responsible for directly managing a system’s hardware resources like CPU, memory and storage. Linux is one of the most widely-used open-source operating system. It is a bundle of tools, programs and services along with the lInux kernel which provides a fully functional operating system. Linux can be differentiated from other operating systems in many ways. Firstly, Linux is an open-source software. Different Linux distributions come with different software options. Each distribution has its own approach on desktop interfaces. As such, users have the ability to choose core components such as graphics, user-interface, etc., as per their preference. Here, we have attempted to cover the widely used Linux commands. With new Linux distributions, there are chances of a few commands getting deprecated. So, make sure you keep up with the new releases, their new additions and commands which are rendered deprecated.
CTRL + W Cuts or deletes the entire line that has been typed. Screen This command is used to switch between multiple virtual terminals. It is mainly useful with remote login. By default, you start with one terminal. CTRL + A & C can be used to create a new virtual terminal. CTRL + N CTRL + N is used to go to the next virtual terminal CTRL + P CTRL + P is used to go to the previous virtual terminal. CTRL + C This combination key breaks/kills a process that is running on the terminal. CTRL + ALT
Send information to a file. cat file1 file2 > file1_and2.txt
< Inserts information into a text file. It is generally used with other commands that are used to extract information through standard input. Ex: tr ‘[A-Z]’ ‘[a-z]’ <filename.txt
newfilename.txt
Appends information at the end of file. It creates the file if it does not exist. << It is mainly used in shell scripting. It is also used with command that are used to extract information. 2> Used for redirecting error output. | It sends the output of one command as an input for another command. Tee Sends the output of a file to the standard output.
tee -options file_name.txt &> Used to redirect output to a specific location make &> /dev/null Command Substitution Used to direct the output of the second command to the first command. 1st_command 2nd_command -options
ln Used to create a link to a file. Links can be hard-links or symbolic links. A hard-link is a reference to a file while a symbolic-link is similar to a shortcut link. ln target_name link_name ln -s target_name link_name shred Overwrites a file and removes it in order to make it irretrievable by the software or hardware. shred -n 2 -z -v /dev/hda du It is used to display information about the file size. It can also be used on directories, which then displays the information about all the size of all the files and subdirectories. du -options file_name/directory_name file It shows the type of a particular file. It displays the inode number, creation data/access date along with some advanced options. file file_name stat Give detailed information about a file. stat file dd Used to create copies of disks, perform conversions on files and very the block size while writing the file. dd operand dd option dd inputfile_path outputfile_path touch Used to create empty files. It is also used to increase the timestamps on the file. touch -t 09072019 filename.txt split It is used to split files into several small files. split -options filename split -b xx – splits the file into xx bytes, split -k xx – splits the file into xx kilobytes split -m xx – splits the file into xx megabytes rename It is used to rename files as per regular expression. rename -options file_name
whoami It tells the username of the logged in user. whoami – it does not need or take any options. free Displays memory status. (Total, Used, Free, cached, Swap) free -tm, where t displays the total statistics and m displays the space in megabytes. uptime | w It displays how long the computer has been up and running. Additionally, it displays the number of users and the processor load. uname It is used to display system information such as OS type, kernel version, etc. uname -options, where the options can be – a, n, m, s, r, p xargs This command is used to run a command as many times as required. Ex: ls | xargs grep “search string” The various options that go with it are:
chsh This command is used to change the login shell. chsh [enter] <shell_name> to be used every time you login. chfn This command is used to change the finger information. This change is reflected in the /ect/passwd file chfn user_name passwd This command can only be executed by the root user. It allows the user to change the password of a user. passwd username
unique contents of file2 and those common to both in three separate columns. Options -1, -2, -3 can be used to suppress the display of the corresponding column. look This command enables you to display a list of words from the system dictionary that begins with a specified string. look
ifconfig This command is used to configure network parameters. ifconfig -options tcpdump It is a program that sniffs packets off network interface and interprets them. sudo tcpdump -I any : captures all packets in any interface. ping It sends echo requests to the specified host and lists the responses received in their round-trip time. ping ip_or_host_name To stop ping – CTRL + C hostname Displays the hostname of the traceroute Shows the route of a packet. traceroute machine_name or IP tracepath It si similar to traceroute, however it does not take complicated options with it. tracepath machine_name or IP findsmb It lists information about machines that respond to SMB name queries findsmb telnet This command helps to establish connection between two hosts. telnet [hostname] nmap It is used to query machines, if they are up and which ports they are on. nmap machine_name ip The ip command is used to perform network administration tasks. It can be used to set or delete ip addresses, verify changes, show routing table, change the default route, show network statistics, monitor netlink messages, activate and deactivate network interface and more. ip a (ip address) ip (link) ip -s(ip stats) ip tunnel ip r host Looks up the internet address using the Domain Name Server. host_ipaddress | host domain_name dig It is the domain information groper tool which outputs IP address, hostname and various other information. dig -x <ip-address> returns the hostname dig works with various other options. whois Used to look up contact information wget Used for downloading files from the world wide web wget file_url: gets a file from the url wget -m: archives a single website wget -nc: to avoid overwriting and already archived file. wget -c: to continue archiving a file that was previously unfinished. curl It is used to download information remotely. It works without user interaction and supports many internet protocols. It can access dictionary servers, ftp, http, gopher,etc. curl -M: this will take you to its manual page. It has a lot many options going with it for accomplishing various tasks.
at ‘at’ is used to execute a command once on a specified day, at a specified time. at 22: Then type the command and press the end-of-file key. at now+time Runs the command at the + the time time specified. at -f shell_script now+1hr atq Lists the job in the queue. It does not take any options. atrm Removes a job from the at queue. atrm job_no cron It is used to schedule a particular function every minute, hour, day, week or month. anacron is a command used for machines which are switched off. It runs the command when the machine is next switched on. crontab It edits, reads and removes the files read by the cron daemon. -e – edits file -l – lists the contents of the file -u username – to works with other uses crontab file. Shortcut Commands @reboot Runs the command at reboot @yearly | @annually Same as 0011* @monthly Same as 001** @weekly Same as 00** @daily | @midnight Same as 00*** @hourly Same as 0**** Conclusion Linux is one of the most reliable operating system. Being an open-source software it can be installed in as many computer systems for free. It works without any trouble with malwares or viruses. A regular recommended update works just fine for this OS. For more information, you can look into tutorials provided by Linux.com and several Documentation Projects that are available online.