[linux] Command notes that you often forget

environment

zsh

Pipe command

alias -g A='| awk'
alias -g C='| pbcopy'
alias -g G='| grep --color=auto'
alias -g H='| head'
alias -g S='| sort'
alias -g T='| tail'
alias -g L='| less -iMR'
alias -g X='| xargs'

Check file size

install ncdu

apt install ncdu

This is the fastest, easiest and most convenient df, du command is too lazy

Whole system

df

Current directory (1st level)

du -sh ${pwd}

Current directory (all levels)

du -Sh ${pwd}

Lowercase s: 1st level Uppercase S: All levels -h: By size

alias setting


alias size='echo 'List of sizes for all levels' && du -Sh ${pwd}* | sort -h'
alias size1='echo '1 layer size list' && du -sh ${pwd}* | sort -h'

Add user to group

sudo adduser username groupname   

User information

who
whoami
${whoami}
Same as -a, --all -b -d --login -p -r -t -T -u -b, --boot The last time the system booted -d, --dead Show terminated processes -H, --heading Show header lines --ips print ips instead of hostnames. with --lookup, canonicalizes based on stored IP, if available, rather than stored hostname -l, --login Show system login process --lookup Attempt to get the official host name from DNS -m Show only host name and user associated with standard input -p, --process Shows active processes started by init -q, --count Login name and number of logged-in users -r, --runlevel Show current runlevel -s, --short Show only name, line and time (standard) -t, --time Shows the time when the system time was last changed -T, -w, --mesg Add user message status with +,-or? -u, --users List logged in users

Version confirmation

cat /etc/os-release

Authority

chmod: (change mode) Change file and directory permissions

chmod 755 data
chmod -R 755 data
r 4 Read permission
w 2 Write permission
x 1 Execution authority

chown: (change owner) Change the owner of a file or directory

chown username data
chown -R username data

chgrp: (change group) Change groups of files and directories

chgrp usergroup data
chgrp -R usergroup data

font

fc-cache -Ev
fc-cache -fv
-E, --error-on-no-fonts raise an error if no fonts in a directory -f, --force scan directories with apparently valid caches -r, --really-force erase all existing caches, then rescan -s, --system-only scan system-wide directories only -y, --sysroot=SYSROOT prepend SYSROOT to all paths for scanning -v, --verbose display status information while busy -V, --version display font config version and exit -h, --help display this help and exit

Recommended Posts

[linux] Command notes that you often forget
Linux commands that you often forget
Personal notes-Memo that you often forget and look up 2016.10
Linux command # 4
Linux command # 5
Linux command list
linux at command
[Linux] Search command
Linux study notes
Linux [directory command]
Linux server command
Linux # Command Memo 1
Linux command [read]
Linux Command Summary
[Basic] linux command
Linux [shell command]
[Linux] Command / Knowledge
Linux command that can be used from today if you know it (Basic)
My linux command
Linux command <Basic 1>
An app that you must put in Linux
Linux command collection
Linux mkdir command
Linux command basics
[Linux] Git command
Linux (command memory)
[Linux] Volume configuration command
Command line introductory notes
Linux command cheat sheet
Linux command (sequential update)
Linux basic command memorandum
Linux command [File operation]
[Linux] Basic command summary
Linux command for self-collection
linux command error collection 1
Linux command line shortcut
Arch Linux installation notes
Network (mainly Linux) notes
A general-purpose program that formats Linux command strings in python
python Condition extraction from a list that I often forget
A memorandum that you will often use in Python's Selenium