System administrator commands in linux

25 Useful Linux Commands for System Administrators

Linux is a popular open-source operating system used by many system administrators for managing their servers and infrastructure. As a system administrator, it is essential to have a good understanding of Linux commands to manage and troubleshoot system efficiently. In this article, we will discuss 25 useful Linux commands for system administrators, along with their examples.

ls — List Directory Contents

The ls command is used to list contents of a directory. By default, it lists files and directories in current directory.

Example − To list all files and directories in current directory, use following command −

cd — Change Directory

The cd command is used to change current working directory.

Example − To change current directory to /usr/local/bin, use following command −

pwd — Print Working Directory

The pwd command is used to print current working directory.

Example − To print current working directory, use following command −

mkdir — Make Directory

The mkdir command is used to create a new directory.

Example − To create a new directory called test, use following command −

rm — Remove Files or Directories

The rm command is used to remove files or directories.

Example − To remove a file called myfile.txt, use following command −

rmdir — Remove Directories

The rmdir command is used to remove directories.

Example − To remove a directory called test, use following command −

cp — Copy Files or Directories

The cp command is used to copy files or directories.

Example − To copy a file called myfile.txt to a new location /tmp, use following command −

mv — Move or Rename Files or Directories

The mv command is used to move or rename files or directories.

Example − To rename a file called myfile.txt to newfile.txt, use following command −

Читайте также:  Изменить разрешение экрана линукс терминал

cat — Display File Contents

The cat command is used to display contents of a file.

Example − To display contents of a file called myfile.txt, use following command −

tail — Display Last Part of a File

The tail command is used to display last part of a file.

Example − To display last 10 lines of a file called myfile.txt, use following command −

head — Display First Part of a File

The head command is used to display first part of a file.

Example − To display first 10 lines of a file called myfile.txt, use following command −

less — Display File Contents Page by Page

The less command is used to display file contents page by page.

Example − To display contents of a file called myfile.txt page by page, use following command −

top — Display System Resource Usage

The top command is used to display system resource usage, such as CPU and memory usage.

Example − To display system resource usage, use following command −

ps — Display Running Processes

The ps command is used to display running processes.

Example − To display running processes, use following command −

kill — Terminate Processes

The kill command is used to terminate processes.

Example − To terminate a process with a process ID of 1234, use following command −

df — Display Disk Space Usage

The df command is used to display disk space usage.

Example − To display disk space usage for all mounted file systems, use following command −

du — Display Directory Space Usage

The du command is used to display directory space usage.

Example − To display directory space usage for current directory, use following command −

ifconfig — Configure Network Interfaces

The ifconfig command is used to configure network interfaces.

Example − To display network interface information, use following command −

ping — Test Network Connectivity

The ping command is used to test network connectivity.

Example − To test network connectivity to a host with IP address 192.168.1.1, use following command −

netstat — Display Network Connections

The netstat command is used to display network connections.

Example − To display active network connections, use following command −

ssh — Securely Connect to a Remote System

The ssh command is used to securely connect to a remote system.

Example − To connect to a remote system with IP address 192.168.1.1, use following command −

scp — Securely Copy Files Between Systems

The scp command is used to securely copy files between systems.

Example − To copy a file called myfile.txt from local system to a remote system with IP address 192.168.1.1, use following command −

scp myfile.txt user@192.168.1.1:/path/to/destination

wget — Download Files From Web

The wget command is used to download files from web.

Example − To download a file from a website, use following command −

wget https://example.com/file.zip

tar — Create and Extract Compressed Archives

The tar command is used to create and extract compressed archives.

Читайте также:  Raid массив для линукс

Example − To create a compressed archive of a directory called mydir, use following command −

tar -czvf mydir.tar.gz mydir

crontab — Schedule Tasks to Run at Specific Times

The crontab command is used to schedule tasks to run at specific times.

Example − To schedule a task to run every day at 2am, use following command −

useradd — Add a New User to System

The useradd command is used to add a new user to system.

Example − To add a new user with username «john», use following command −

passwd — Change User Password

The passwd command is used to change password of a user.

Example − To change password for user «john», use following command −

sudo — Execute a Command with Superuser Privileges

The sudo command is used to execute a command with superuser privileges.

Example − To execute a command as a superuser, use following command −

Conclusion

In conclusion, Linux commands are essential for system administrators to manage and troubleshoot their systems efficiently. above 25 commands are just a few of many commands available in Linux. By mastering these commands, you can become more proficient in managing Linux systems. I hope this article has been useful in providing you with some useful Linux commands to help you in your role as a system administrator.

Источник

60 Commands of Linux : A Guide from Newbies to System Administrator

For a person new to Linux, finding Linux functional is still not very easy even after the emergence of user friendly Linux distribution like Ubuntu and Mint. The thing remains that there will always be some configuration on user’s part to be done manually.

Linux Administration Commands

Just to start with, the first thing a user should know is the basic commands in terminal. Linux GUI runs on Shell. When GUI is not running but Shell is running, Linux is running. If Shell is not running, nothing is running. Commands in Linux is a means of interaction with Shell. For a beginners some of the basic computational task is to:

  1. View the contents of a directory : A directory may contains visible and invisible files with different file permissions.
  2. Viewing blocks, HDD partition, External HDD
  3. Checking the integrity of Downloaded/Transferred Packages
  4. Converting and copying a file
  5. Know your machine name, OS and Kernel
  6. Viewing history
  7. Being root
  8. Make Directory
  9. Make Files
  10. Changing the file permission
  11. Own a file
  12. Install, Update and maintain Packages
  13. Uncompressing a file
  14. See current date, time and calendar
  15. Print contents of a file
  16. Copy and Move
  17. See the working directory for easy navigation
  18. Change the working directory, etc…

And we have described all of the above basic computational task in our First Article.

This was the first article of this series. We tried to provide you with detailed description of these commands with explicit examples which was highly appreciated by our reader in terms of likes, comments and traffic.

What after these initial commands? Obviously we moved to the next part of this article where we provided commands for computational tasks like:

  1. Finding a file in a given directory
  2. Searching a file with the given keywords
  3. Finding online documentation
  4. See the current running processes
  5. Kill a running process
  6. See the location of installed Binaries
  7. Starting, Ending, Restarting a service
  8. Making and removing of aliases
  9. View the disk and space usages
  10. Removing a file and/or directory
  11. Print/echo a custom output on standard output
  12. Changing password of on-self and other’s, if you are root.
  13. View Printing queue
  14. Compare two files
  15. Download a file, the Linux way (wget)
  16. Mount a block / partition / external HDD
  17. Compile and Run a code written in ‘C’, ‘C++’ and ‘Java’ Programming Language
Читайте также:  Установка линукс из под windows xp

This Second Article was again highly appreciated by the readers of Tecmint.com. The article was nicely elaborated with suitable examples and output.

After providing the users with the glimpse of Commands used by a Middle Level User we thought to give our effort in a nice write-up for a list of command used by an user of System Administrator Level.

In our Third and last article of this series, we tried to cover the commands that would be required for the computational task like:

  1. Configuring Network Interface
  2. Viewing custom Network Related information
  3. Getting information about Internet Server with customisable switches and Results
  4. Digging DNS
  5. Knowing Your System uptime
  6. Sending an occasional Information to all other logged-in users
  7. Send text messages directly to a user
  8. Combination of commands
  9. Renaming a file
  10. Seeing the processes of a CPU
  11. Creating newly formatted ext4 partition
  12. Text File editors like vi, emacs and nano
  13. Copying a large file/folder with progress bar
  14. Keeping track of free and available memory
  15. Backup a mysql database
  16. Make difficult to guess – random password
  17. Merge two text files
  18. List of all the opened files

Writing this article and the list of command that needs to go with the article was a little cumbersome. We chose 20 commands with each article and hence gave a lot of thought for which command should be included and which should be excluded from the particular post. I personally selected the commands on the basis of their usability (as I use and get used to) from an user point of view and an Administrator point of view.

This Articles aims to concatenate all the articles of its series and provide you with all the functionality in commands you can perform in our this very series of articles.

There are too long lists of commands available in Linux. But we provided the list of 60 commands which is generally and most commonly used and a user having knowledge of these 60 commands as a whole can work in terminal very much smoothly.

That’s all for now from me. I will soon be coming up with another tutorial, you people will love to go through. Till then Stay Tuned! Keep Visiting Tecmint.com.

Like and Share and Help us to Spread

Источник

Оцените статью
Adblock
detector