Tech Articles

Overview of 157 Linux Basic Commands

People who don’t know what Linux is sometimes ask us if it’s a program that runs on Microsoft Windows. When we tell them that Linux is, itself, an operating system like Windows and that they can remove (or never purchase) Windows, We sometimes get a surprised reaction: “A PC can run with nothing from Microsoft on it?

In 1991, Linus Torvalds, a student at the University of Helsinki, Finland, started work on a UNIX-like kernel because he wanted to be able to use the same kind of operating system on his home PC that he used at school. At the time, Linus was using Minix, but he wanted to go beyond what the Minix standards permitted.

As noted earlier, Linus announced the first public version of the Linux kernel to the comp.os.minix newsgroup on August 25, 1991, although Linus guesses that the first version didn’t actually come out until mid-September of that year.

Here are the list of Linux basic commands:

S.No Command Explanation
1 alias Allows you to set aliases and view the current aliases.
2 awk Search for a pattern within a file.
3 alien Converts .tgz and rpm’s to .deb format.
4 banner Prints characters as a poster.
5 badblocks Searches a device for bad blocks.
6 biff Turns mail notification on and off.
7 bg Move a job running in the foreground to the background.
8 bzip2 Used to compress and decompress files. Similar to gzip.
9 cardctl Used to control PCMCIA cards.
10 cfdisk Used to partition a hard disk.
11 cp Copy
12 chattr Changes the attributes of a file or folder.
13 chroot Change the root directory for a command.
14 chmod Used to change permissions on a directory or file.
15 chown Used to change the owner of a file or directory.
16 chgrp Used to change the group a file belongs to.
17 clear Clears the screen
18 cpio Copies file.
19 cat Displays the content of a file
20 chpasswd Used to change a large number of passwords at once.
21 cd Changes directories.
22 chage Sets password aging parameters.
23 cal Displays a calendar.
24 cron Used to execute commands at a certain time.
25 crontab Allows you to view or edit the current cron jobs.
26 dselect A graphical front end for dpkg.
27 dpkg Installs packages on debain distro’s.
28 date Prints current date to the screen
29 du Lists disk usage in a directory.
30 df Reports disk usage information. df -h
31 dmesg Used to view the kernel boot file.
32 dump Used for backing up.
33 edquota Sets quotas for specific users.
34 env Lists current environment variables.
35 fdisk Used to create/edit/delete partitions.
36 fsck Checks a file system for consistency.
37 fg Used to send jobs to the background.
38 fuser Checks to see what processes and users have open files.
39 find Searches for a file.
40 free Will show total memory, used memory, and free memory.
41 gcc Used to compile C, Assembler, and Preprocessed C source.
42 gpasswd Used to set a password for a group.
43 grep Used to search through a file for a specified pattern.
44 getty Set terminal type, modes, speed, and line discipline
45 groupadd Create new group account.
46 groupdel Deletes a group.
47 groupmod Used to modify a group.
48 groups Shows what groups a user is part of.
49 gunzip Uncompress files compressed by gzip.
50 head Displays the first 10 lines of a file to the screen.
51 hdparm Gets disk information.
52 history Lists recently executed commands.
53 host Used to get DNS info.
54 htpasswd Allows you to set usernames and passwords for your websever.
55 id Display information about yourself or another user.
56 insmod Installs modules.
57 init Used to change run levels.
58 isapnp Sets up ISA cards.
59 icmpinfo Intercept and interpret ICMP packets
60 jobs Used to show jobs running in the background.
61 join Join lines of two sorted.
62 kill Used to kill a process.
63 killall Kill processes by command name.
64 kernelcfg A graphical application configures Linux.
65 klogd Control which kernel messages.
66 linuxconf A command line GUI which lets you configure your linux.
67 lpc Used to control a line printer.
68 lpq View the print spool queue.
69 lpr Send files to the printer spool queue.
70 ls Displays a directories contents.
71 ln Used to create hard and symbolic links.
72 less Display the contents of a file.
73 locate Search for a file or directory.
74 ldd Shows what shared libraries a program is dependent on.
75 ldconfig Used to configure/view shared libraries.
76 last Lists logins and reboots.
77 lastlog Print the last login times for system accounts.
78 lsmod Lists loaded modules.
79 lsattr Lists the attributes for a file or folder.
80 logrotate Used to manipulate log files.
81 mount Used by itself, reports the currently mounted files.
82 modinfo Give info about the module.
83 modprobe Queries modules.
84 man Displays the Man page for a given command.
85 mesg Used to allow/not allow ‘write’.
86 manpath Attempts to determine the path to a man page.
87 mail Used to send and receive mail.
88 mkdir Make directory
89 mke2fs Used to format a partition with the Ext2 file system.
90 mv Move/Rename
91 merge Merge multiple files together.
92 more Lets you page through text one screen full at a time.
93 minicom Great utility for troublshooting a modem.
94 mkbootdisk Used to make a boot disk.
95 ntsysv Used to select what services should automatically start.
96 nice Used to set process priorities.
97 nslookup Used to get DNS info from name servers.
98 netstat Shows active sockets.
99 ps Displays current processes
100 ping Used to test connectivity between two hosts.
101 pwd Present Working Directory
102 pwconv Used to set up the /etc/shadow file.
103 pnpdump Determines settings for existing ISA cards.
104 quota Allows users to view their own disk quotas.
105 quotaon Turns on disk quotas for the system.
106 quotaoff Turns off disk quotas for the system.
107 repquota Provides reports of disk usage for various users.
108 rmmod Removes modules.
109 rm Remove
110 rmdir Remove directory
111 rpm (RedHat flavors only) Used to install RPM’s
112 rpcinfo Used to see what rpc services are available.
113 route Used to view/change routes between you and other hosts.
114 smbclient Used to connect to Windows shares or Samba.
115 smbadduser Maps linux user names to Windows NT user names.
116 smbpasswd Used to update the smbpasswd file with new accounts.
117 set Used to read and write variables.
118 setquota Used to set disk quotas.
119 sort Sorts lines in a file by alphabetical order.
120 sndconfig Used to probe and configure a sound card.
121 su Change to Super User (root).
122 spell Checks for spelling errors in a file.
123 startx Start the X Server (GUI)
124 shutdown Shutdown machine
125 suspend Places a shell in the background.
126 showmount Shows mount information for an NFS server.
127 swapon Turns on the swapfile.
128 swapoff Turns off the swapfile.
129 testparm Used to troubleshoot Samba.
130 tar Used to compress multiple files.
131 timeconfig Used to set the timezone on your machine.
132 tac View a file from the last line up.
133 touch Creates an empty file.
134 tail Displays the last 10 lines of a file to the screen.
135 talk Used to chat with another user on the same machine.
136 tr Converts one set of characters to another.
137 traceroute Used to track the path a packet takes to a host.
138 top Shows information about the most CPU-intensive Apps.
139 useradd Add a user.
140 usermod Modify a user.
141 userdel Delete a user.
142 umount Removes a device from the filesystem.
143 updatedb Updates the locate database.
144 uname Determines OS name, version and machine name.
145 vmstat Lists information on memory usage.
146 vi A text editor
147 whereis Finds documentation files.
148 who Tells you who is logged into your server.
149 whoami Tells you your user information.
150 wc Print the number of bytes, words, and lines in files.
151 which Finds the full path for a command.
152 write Used to send a message to another user.
153 whois Used to query servers for info on.
154 wall Writes a message to all logged in users.
155 xman Graphical interface for man pages.
156 xf86config Used to configure X.
157 zcat Read files that have been compressed with gzip.

Have something to say about this article? Comment below or share it with us on Facebook or Twitter.

H4ck0
Step by step hacking tutorials about wireless cracking, kali linux, metasploit, ethical hacking, seo tips and tricks, malware analysis and scanning.
https://www.yeahhub.com/

WHERE SHOULD WE SEND ?

HACKING TUTORIALS & INFOSEC NEWS?

Subscribe to Our Newsletter and Get Instant Delivered to Your Email Inbox.

We respect your privacy and take protecting it seriously.

Leave a Reply

Your email address will not be published. Required fields are marked *

five + 7 =