Skip to content

Latest commit

 

History

History
181 lines (123 loc) · 2.29 KB

shell.org

File metadata and controls

181 lines (123 loc) · 2.29 KB

Command lines - Shell

Shell

system information

uname -a

print working directory

pdw

print application directory

which _

create folder

mkdir -p _

list all files (including hidden)

ls -a

view permission

ls -l

view permission (extended attributes)

ls -l@

view permission as number (chmod)

stat --format '%a' <file>

permission (read only)

chmod 400 _

permission (all user)

chmod 755 _

permission (this user only)

chmod 700 _

permission (executable)

chmod +x _

permission (executable for this user only)

chmod u+x _

view home directory

echo $HOME

view shell type

echo $SHELL

view value of PATH variable

echo $PATH

add a new path to PATH variable

export PATH="$PATH:`pwd`/_"

source .bash_profile from .zprofile

if [ -r ~/.bash_profile ]; then
   source ~/.bash_profile
fi

source .bashrc from .bash_profile

if [ -r ~/.bashrc ]; then
   source ~/.bashrc
fi

ddd path to .bashrc

cd ~
vi .bashrc
export PATH=$PATH:/_
:q!
source ~/.bashrc
echo $PATH

recursively list folder content

ls -R

recursively list folder content with exclusion

ls | grep -v 'name'

recursively find all files with extension

find . -name "*.___" -type f

recursively delete all files with extension

find . -name "*.___" -type f -delete

recursively find all files with extension and copy to folder

find . -name "*.___" -type f -exec cp {} ./foldername \;

view available memory (RAM)

free -h

monitor system resources

htop

monitor disk space

df -H