70+ basic Linux🐧 commands explained.

Hey everyone👋! I am finally BACK with another Linux🐧 thread!

In today's thread🧵, I will be going over basics commands every Linux user should know !

A Mega🧵 thread
Have grouped these commands so you can easily Identify their usage.

- Linux Manual/Help Commands
- Linux File Commands
- Linux Directory Commands
- Linux File Content Commands
- Linux User Commands
- Linux Filter Commands
- Linux Utility Commands
- Linux Networking Commands
Pro tip💡: There is no need to memorize all the commands options/arguments, just make use of the help menu or manual pages to find the usage of a specific command/option you want.

continue to read👇
🐧 Linux Manual/Help📑 Commands

1. man
The man command is used to display the user manual of any command that we can run on the terminal.
2. whatis
Whatis command is used to get a one-line manual page description of a command.
🐧 Linux File🧾 Commands

3. cat Command
The cat command is a multi-purpose utility in the Linux system. It can be used to create a file, display content of the file, copy the content of one file to another file, and more.
4. touch
The touch command is used to create empty files and also change file timestamps. We can create multiple empty files by executing them once.
5. rm
The rm command is used to remove a file or files. Be wary when using this command, this command can be dangerous if you don't use it properly.
For more details on the dangers of this command check out this thread.
6. cp
The cp command is used to copy a file(s) or directory(ries) from one location to another.
7. mv
The mv command is used to move/renaming a file(s) or a directory(ries) from one location to another location. A file can be renamed during a move process using the mv command.
This command can be dangerous too if you use it improperly, refer to this if you want to know the dangers.
8. rename
This command is useful for renaming files or a group of files on Linux.
🐧Linux Directory📂 Commands

9. pwd
pwd stands for print working directory. It is used to display the location of the current working directory you are current working in.
10. mkdir
mkdir stands for make directory, this command is used to create directory and subdirectories in any directory.
11. rmdir
rmdir stands for remove directory, it is used to to delete directories
12. rm
This command can also delete folders when used with the combination -rf options.

-f, --force
ignore nonexistent files and arguments, never prompt

-r, -R, --recursive
remove directories and their contents recursively
13. ls
Ls is the most used command in Linux, this command is used to list the contents of directory/subdirectories. The ls has a lot of handy options which I would advise you to check the help or man pages if you want to know more about them.
14. cd
Change Directory (cd) - used to change the current working directory to another directory.
🐧Linux File Content📜 Commands
15. head
This command is used to display the content of a file. It displays the first 10 lines of a file but default, but you can always change it to display first number of lines specified.
16. tail
This command similar to the head command. The difference is that this command displays the last ten lines of the file content by default, but you can always change this behavior if you want. It is useful for reading the error message.
17. tac
tac is the reverse of cat command, you can clearly see that from its name. It displays the file content in reverse order (from the last line).
18. more
The more command is quite similar to the cat command, as it is used to display the file content in the same way that the cat command does. But the main drawback of the cat command is that you can’t control what’s happening after you start it.
The more command displays a text fi le, but stops after it displays each page of data.
19. less
Similar to the more command, the less command is an advanced version of the more command. (the less command name comes from the phrase “less is more”) It also includes some extra features such as 'adjustment in width and height of the terminal.
Refer to this thread if you want to know more about these commands:
🐧Linux User/Group👨‍👨‍👦 Management Commands
20. su
This command allows administrative access to another user. It allows access of the Linux shell of another user. It also run a command with substitute user and group ID.
21. id
command is used to display the effective user ID (UID) and effective group ID (GID).
22. useradd
useradd command is used to add or remove a user on a Linux server
-m - create home directory
-p - new user password
-s - user login shell
xtremepentest - new username
23. adduser
Similar to the useradd command, the adduser is also used to add users on a Linux system. This command provides an interactive way of adding a user unlike the useradd command.
24. usermod
Used to modify a user account i.e changing user home directory, username, enforcing password expiry policies, changing user groups, etc.

Here we are changing the user xtremepentest's password and login shell.
25. chfn
This command is used change real user name and information.
26. finger
user information lookup program. This command displays specified user information. By default it displays the currently logged in user information.
27. groupadd
The groupadd command is used to create a user group.
28. addgroup
Similar to the groupadd command, addgroup is also used to create user groups.
The only difference is that groupadd is usually preferable for scripting (say, if you wan't to create users in batch), whereas addgroup is more user friendly (especially if you are unfamiliar with all the options and flags).
29. groupmod
this command is used to modify a group definition on the system
30. groups
print the all the groups a user is in.
31. users
print the user names of users currently logged in to the current host.
32. who
show who is logged on
33. whoami
print effective userid
🐧Linux Filter/Text📑 Manipulation Commands
34. cut
This command is used to select a specific column of a file. The '-d' option is used as a delimiter, and it can be a space (' '), a slash (/), a hyphen (-), or anything else. And, the '-f' option is used to specify a column number. Example: printing all available usernames
35. grep
grep is the most powerful and used filter in a Linux system. The 'grep' stands for global regular expression print." It is useful for searching the content from a file. Generally, it is used with the pipe.
36. comm
The comm command is used to compare two files or streams. By default, it displays three columns, first displays non-matching items of the first file, second indicates the non-matching item of the second file, and the third column displays the matching items of both files
37. sed
Sed command is also known as stream editor. It is used to edit files using a regular expression. It does not permanently edit files; instead, the edited content remains only on display. It does not affect the actual file. Here is an example of substituting words.
38. gawk/awk
gawk command in Linux is used for pattern scanning and processing language. The awk command requires no compiling and allows the user to use variables, numeric functions, string functions, and logical operators.
39. tee
The command is quite similar to the cat command. The only difference between both filters is that it puts standard input on standard output and also write them into a file.
40. tr
This command is used to translate the file content from lower case to upper case, delete characters.
Here is an example of deleting ":" character
Here is an example of translating characters:
In this example I have translated all ":" to "-".
41. diff
The diff command simply compares two text sources/text files and outputs their differences. It compares the files line by line to find the differences.
42. uniq
is used to form a sorted list in which every word will occur only once.
Note💡: 'uniq' does not detect repeated lines unless they are adjacent. You may want to sort the input first, or use 'sort -u' without 'uniq'.
43. sort
command is used to sort files in alphabetical order. It also used in place of the uniq command
44. wc
command is used to count the lines, words, and characters in a file.
45. od
command is used to display the content of a file in different formats, such as hexadecimal, octal, and ASCII characters.
46. nl
Displays line numbers in a file.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Traw | XtremePentesting

Traw | XtremePentesting Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @xtremepentest

9 Dec
Websites/Platforms 🌐 to learn to hack 🕵️

⚗️Cybersecurity training platform

→ Hackthebox
→ Hacxpert
→ Tryhackme
→ Pentester Lab
→ Vulnhub
→ Cybrary
→ CybersecLabs
→ Root Me
→ OverTheWire
→ Vulnmachines
→ RangeForce
→ certifiedsecure
→ EchoCTF
→ Try2Hack

thread
🌐Web Exploitation
→ Hacxpert
→ Portswigger Web Security Academy
→ Bug Bounty Hunter
→ Pentester Lab
application.security
→ OWASP Juice Shop
→ OWASP WebGoat
→ bWAPP
→ OWASP Broken Web Application
🏁CTF Based Learning
→ CTFTime
→ PicoCTF
→ 247CTF
→ Hackthissite
→ WeChall
→ W3challs
→ Hacker101
→ IO wargame
Read 11 tweets
8 Dec
🐧Linux Utility🧰 Commands
47. gzip
The gzip command is used to reduce the file size. It is a compressing tool. It replaces the original file by the compressed file having '.gz' extension.
By default the gzip will delete the original files after compressing them. If you don't want the files to get deleted you use the -d option. Image
Read 30 tweets
26 Nov
A thread of my Linux threads🧵
1. Useful Linux🐧 Terminal Keyboard⌨️ Shortcut Keys To Boost🚀 Your Productivity📈

2. Basic Linux 🐧Commands📜 For Text Manipulation.

Read 20 tweets
24 Nov
Simple Bash/ZSH GOD-LIKE History Tricks Every Linux User Should Know!

A thread 🧵

Hello everyone👋. For today's Linux thread🐧, I'll be showing some GOD-LIKE bash/zsh history tricks which will save you plenty of time⏰ and doing your day to day tasks on the Linux terminal. Image
Effectively using bash history will save you plenty of time in the Linux terminal. Not only this will save you plenty of time, but it will also make your life much easier when you are using the Linux Terminal to perfom day to day tasks as regular user, penterser, dev or sysadmin.
1⃣View the Bash History
The simplest way to view commands you have used earlier is to use the history bash built in command. Image
Read 22 tweets
21 Nov
Useful Linux🐧 Terminal Keyboard⌨️ Shortcut Keys To Boost🚀 Your Productivity📈

A thread🧵

Hello everyone👋, Today I'll be doing another quick, easy to follow thread🧵on a few Linux terminal keyboard shortcuts keys that will help you to complete a few tasks real quick.
1. CTRL + A⌨️
2. CTRL + E⌨️
Read 14 tweets
19 Nov
Useful Linux🐧 Networking🌐 Commands📜 for Sysadmins/Regular Users🧑‍💻

A thread🧵
Hello everyone👋, Today I'll be doing another quick, easy to follow thread🧵 on some of the most used command-line tools and utilities for network management in Linux

#infosec #CyberSecurity #Linux
1. Ifconfig🌐
Ifconfig stands for Interface Configurator, it is one of the most used commands for finding network details, nitialize an interface, assign IP address, enable or disable an interface. It also display route and network interface.
2. Ip🌐
ip command is the latest version of ifconfig. It is more powerful than ifconfig command as it can perform several other tasks that the ifconfig cannot do. The utility is used for displaying and manipulating routing, network devices, interfaces.
Read 21 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(