list contents of directories in a tree-like format
ex. tree -d -L3
list contents of directories. it only displays directories. the display depth is 3.
get base name of path
ex. basename /home/wildlarva/mytext.txt
=> mytext.txt
ex. basename /home/wildlarva/mytext.txt .txt
=> mytext
get directory of path
ex. dirname /home/wildlarva/mytext.txt
=> /home/wildlarva
display value of a symbolic link it can be also used for displaying absolute path
ex. readlink -f somefile
output absolute path of somefile
trace a pathname until a terminal point is found
ex. namei ~/Practices/C/hello/a.exe
namei outputs results like below
f: /home/wildlarva/Practices/C/hello/a.exe
d /
d home
d wildlarva
l Practices -> /cygdrive/d/Practices/
d /
d cygdrive
d d
d Practices
d C
d hello
- a.exe
rename multiple files
ex. mmv "*.txt" "#1.csv"
change extension of all .txt files in current directory to .csv.
list open files
ex. lsof -c zsh
list open files opened by zsh.
top-like I/O monitor
clear screen
get some sections from each line of files
ex. cut /etc/group -d ':' -f1,3
get group names and ids of /etc/group
build and execute command lines from standard input TODO
output the last part of files
ex. tail -f somefile
output appended data as the file grows.
sort lines of text files
ex. sort -nk3 somefile
sort lines of somefile (compare field 3 as numeric value)
omit repeated lines
ex. sort -nk1 somefile | uniq
omit repeated lines of somefile
output stdin to both of files and stdout
print a sequence of numbers
ex. seq 14
print 1..14
ex. seq 20 10 100
print 20,30,40,..,100
print line, word, byte counts
ex. wc -l filea fileb
print line counts of filea and fileb
performance util
ex. time ls
output ls execution time
print date
ex. date +%Y%m%d
print text including year, month and day
print system information
ex. uname -a
print all information
ex. uname -m
print architecture name (same as arch)
ex. uname -n
print host name (same as hostname)
displays information about elf files
ex. readelf -s
show symbol table
ex. readelf -S
show section headers
ex. readelf -l
show segments
ex. readelf -h
show file header
displays information from object files
ex. objdump -Srl someprg
show assembly and relocation information
list symbols from object files TODO: