TRΓ„W🀟 Profile picture
Dec 8, 2021 β€’ 59 tweets β€’ 17 min read β€’ Read on X
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 TRΓ„W🀟

TRΓ„W🀟 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 @thatstraw

Jul 11
Linux filesystem and directory structure🐧

πŸ“ /
β”œβ”€β”€ πŸ“ bin
β”‚ β”œβ”€β”€ βš™οΈ ls
β”‚ └── βš™οΈ bash
β”œβ”€β”€ πŸ“ boot
β”‚ β”œβ”€β”€ πŸ’Ύ vmlinuz
β”‚ └── πŸ’Ύ initrd.img
β”œβ”€β”€ πŸ“ dev
β”‚ β”œβ”€β”€ πŸ’Ώ sda1
β”‚ └── πŸ’Ώ sdb
β”œβ”€β”€ πŸ“ etc
β”‚ β”œβ”€β”€ πŸ› οΈ passwd
β”‚ └── πŸ› οΈ fstab
β”œβ”€β”€ πŸ“ home
β”‚ β”œβ”€β”€ πŸ“ james
β”‚ β”‚ β”œβ”€β”€ πŸ› οΈ .bashrc
β”‚ β”‚ β”œβ”€β”€ πŸ“ documents
β”‚ β”‚ └── πŸ“ .ssh
β”‚ β”‚ β”œβ”€β”€ πŸ” id_rsa
β”‚ β”‚ └── πŸ”‘ authorized_keys
β”‚ └── πŸ“ traw
β”‚ β”œβ”€β”€ πŸ› οΈ .profile
β”‚ β”œβ”€β”€ πŸ“ pictures
β”‚ └── πŸ“ .ssh
β”‚ β”œβ”€β”€ πŸ” id_rsa
β”‚ └── πŸ”‘ authorized_keys
β”œβ”€β”€ πŸ“ lib
β”‚ β”œβ”€β”€ βš™οΈ
β”‚ └── βš™οΈ
β”œβ”€β”€ πŸ“ media
β”‚ β”œβ”€β”€ πŸ“ cdrom
β”‚ └── πŸ“ usb
β”œβ”€β”€ πŸ“ mnt
β”‚ └── πŸ“ mymount
β”œβ”€β”€ πŸ“ opt
β”‚ └── πŸ“ myapp
β”œβ”€β”€ πŸ“ proc
β”‚ β”œβ”€β”€ πŸ“„ cpuinfo
β”‚ └── πŸ“„ meminfo
β”œβ”€β”€ πŸ“ root
β”‚ β”œβ”€β”€ πŸ› οΈ .bash_history
β”‚ └── πŸ“ .ssh
β”‚ β”œβ”€β”€ πŸ” id_rsa
β”‚ └── πŸ”‘ authorized_keys
β”œβ”€β”€ πŸ“ run
β”‚ β”œβ”€β”€ πŸ“„ utmp
β”‚ └── πŸ“„ systemd
β”œβ”€β”€ πŸ“ sbin
β”‚ β”œβ”€β”€ βš™οΈ init
β”‚ └── βš™οΈ reboot
β”œβ”€β”€ πŸ“ srv
β”‚ └── πŸ“ myservice
β”œβ”€β”€ πŸ“ sys
β”‚ β”œβ”€β”€ πŸ“„ devices
β”‚ └── πŸ“„ firmware
β”œβ”€β”€ πŸ“ tmp
β”‚ β”œβ”€β”€ πŸ“„ temp1
β”‚ └── πŸ“„ temp2
β”œβ”€β”€ πŸ“ usr
β”‚ β”œβ”€β”€ πŸ“ bin
β”‚ β”‚ β”œβ”€β”€ βš™οΈ perl
β”‚ β”‚ └── βš™οΈ python
β”‚ β”œβ”€β”€ πŸ“ lib
β”‚ β”‚ β”œβ”€β”€ βš™οΈ
β”‚ β”‚ └── βš™οΈ
β”‚ └── πŸ“ local
β”‚ β”œβ”€β”€ πŸ“ bin
β”‚ β”œβ”€β”€ πŸ“ lib
β”‚ └── πŸ“ share
└── πŸ“ var
β”œβ”€β”€ πŸ“ log
β”‚ β”œβ”€β”€ πŸ“„ syslog
└── πŸ“„ auth.log
β”œβ”€β”€ πŸ“ mail
β”œβ”€β”€ πŸ“ run
β”œβ”€β”€ πŸ“ spool
└── πŸ“ wwwlibc.so
libm.so
libssl.so
libcrypto.so
πŸ“ / (Root Directory)
β€’ The top-level directory of the filesystem. All other directories and files are contained within this directory.

πŸ“ /bin
β€’ Contains essential binary executables (commands like ls, bash). These are the basic commands needed for system operation.
πŸ“ /boot
β€’ Contains the boot loader files and kernel images (e.g., vmlinuz, initrd.img). These files are necessary to start the operating system.

πŸ“ /dev
β€’ Contains device files representing hardware devices (e.g., sda1, tty). These special files allow software to interact with hardware devices.
Read 10 tweets
Jul 9
REST API Design Image
Looking for a tool that simplifies API management? Introducing Apidog

Designing APIs can be complex, but tools like @ApidogHQ simplify the process. Apidog ( is a comprehensive API design-first development platform that offers numerous features to streamline API development. While many API design and management tools are available, Apidog stands out as a comprehensive solution.

You can check out and try Apidog using this link:
apidog.com/?utm_source=th…Image
Here's why Apidog is becoming the go-to platform for API design:

1. REAL API Design-first Development Platform

Apidog offers visual tools for API design, development, testing, and documentation. Its elegant UI and compatibility with OpenAPI Specification (OAS) eliminate the need for manual coding.

The platform also supports multi-branch API development, making it ideal for teams working on complex projects.Image
Read 8 tweets
Jun 4
If you want to learn Linux bash scripting for FREE, open this: Image
1. Getting Started with Bash Scripting

Bash scripts are a series of commands written in a file that can be executed by the Bash shell. This article will cover the basics of creating and running your first Bash script.
sysxplore.com/create-a-bash-…
2. Comments in Bash

Commenting your code is an essential practice in programming, as it helps you and others understand the purpose and functionality of each section.

In Bash scripting, comments are used to annotate your scripts, making them more readable and maintainable. This article will cover the different ways to add comments in your Bash scripts.
sysxplore.com/comments-in-ba…
Read 19 tweets
Dec 29, 2023
Linux hand-written notes:🧡 ↓ Image
[2] Image
[3] Image
Read 80 tweets
Oct 24, 2023
13 Linux tr command practical examples you should know as a system administrator: Image
The tr command short for translate, is one of the most useful command for manipulating text on the command line.
It allows you to perform useful operations such as converting lowercase characters to uppercase characters, uppercase characters to lowercase characters, character replacing, and deleting characters.

It is usually used in conjunction with other commands via piping.
Read 29 tweets
Jul 2, 2023
Linux user management - how to add users in Linux πŸ§΅β†“
The useradd command is the main tool for adding new users to a Linux system. This command allows you to quickly create a new user account and configure the user's $HOME directory structure.
The useradd command creates a user account by combining system default settings and command-line parameters.

To see the system default values on your Linux distribution, use the useradd command with the -D option:

$ useradd -D
Read 18 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

Don't want to be a Premium member but still want to support us?

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!

:(