[CENTOS] Linux command collection

I would like to summarize frequently used Linux commands by genre. Environment: CentOS

basic operation

# ▽ clear [Overview] Clear screen [Tips] [Control] + [L] is also possible)
clear

# ▽ pwd (print working directory) [Overview] Display the current directory path
pwd

# ▽ cd (change directory) [Overview] Change directory
 cd # Change to the home directory of the currently logged in user
 cd-# Return to the previous directory
 cd .. # Move up one level
 cd / etc / ssh # Move by specifying the path

# ▽ history [Overview] View the history of commands.
history
 Execute the 30 commands displayed in the execution result of! 30 # history
 Execute the 254 commands displayed in the execution result of! 254 # history

Date / time

# ▽ date [Overview] Display the current date and time
date                      # => Sat Aug 12 08:50:30 JST 2017
date +%Y/%m/%d            # => 2017/08/12
date +"%Y %m %d %H %M %S" # => 2017 08 12 08 50 30
date +"%Y-%m-%d %H:%M:%S" # => 2017-08-12 08:50:30

# ▽ cal [Overview] Display the calendar
 The calendar of the cal # command execution month is displayed.
 cal 2020 # 2020 calendar is displayed

User Management

# ▽ id [Overview] Display user information
 id # Display information about the logged-in user
 id apache # apache Show user information => uid = 48 (apache) gid = 48 (apache) groups = 48 (apache)
 id hogehoge # hogehoge Display user information => uid = 1000 (hogehoge) gid = 1000 (hogehoge) groups = 1000 (hogehoge)

# ▽ useradd [Overview] Add a user [Tips] Must be executed by a user with administrator privileges
 useradd hogehoge # hogehoge Add a user
 cat / etc / passwd | grep hogehoge # Confirm

# ▽ passwd [Overview] Set and change user passwords
 passwd hogehoge # hogehoge Change user password
 passwd -S hogehoge # hogehoge Check user status

# ▽ usermod [Overview] Change user settings [Tips] Must be executed by a user with administrator privileges
 usermod -L hogehoge # hogehoge Lock user
 passwd -S hogehoge # Confirm => ... (Password locked.)
 usermod -U hogehoge # hogehoge Unlock user
 passwd -S hogehoge # Confirmation => ... (Password set, SHA512 crypt.)
 usermod -G wheel hogehoge # hogehoge Add a user to the wheel group

# ▽ userdel [Overview] Delete a user
 userdel hogehoge # hogehoge Delete user
 userdel -r hogehoge # hogehoge Delete a user. Delete your home directory as well

Recommended Posts

Linux command collection
linux command error collection 1
Linux command # 4
Linux command # 3
[Note] Useful linux command collection
linux at command
[Linux] Search command
Linux command <Basic 2>
pip command collection
Linux [directory command]
Linux server command
Linux # Command Memo 1
Linux command [read]
Linux Command Summary
[Basic] linux command
[Linux] Command / Knowledge
My linux command
Linux command <Basic 1>
Linux mkdir command
Linux command basics
[Linux] Git command
Linux (command memory)
[Linux] Volume configuration command
Linux command (sequential update)
Linux basic command memorandum
Linux command [File operation]
[Linux] Basic command summary
Linux command for self-collection
Linux command line shortcut
linux sar command CPU usage
[Linux] tar.gz compression / decompression command
What is Linux? [Command list]
[Copy and paste OK] Basic Linux command collection [18 selections]
Easy df command on Linux
Linux
Linux Command Dictionary (for myself)
linux: create original Terminal command
Linux command memorandum [for beginners]
Linux PC spec check command
[Linux] User / group command summary
[Linux convenient command] Try inserting exa
Command to create Linux Live USB
[Linux] OS recovery with restore command
Completion of docker command on Linux
[Linux convenient command] Try inserting csview
Permission and ownership change command [Linux]
LINUX command [wc edition] Usage example
Linux command [ldconfig] LPIC learning memo
[linux] kill command to kill the process
[Linux convenient command] Try inserting bat
Linux command 16 procedure manual folder (completed)
Linux command (basic in basic) personal memo
[Linux Nginx] Command collection used for initial setting of Web server
linux memorandum
Linux commands
Linux commands
Linux overview
Linux basics
Command memorandum
Organize Linux
command prompt