ps -fax | grep node
kill -9 process_id
$ sudo ss -lptn 'sport = :80' or $ sudo netstat -nlp | grep :80 or $ sudo lsof -n -i :80 | grep LISTEN
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head
wget -c -A '*.mp3' -r -l 1 -nd http://example.org/musics/
-c: continue getting a partially-downloaded file.
-A: only accept mp3 files. change this format with another format you want to download.
-r: recurse
-l 1: one level deep (ie, only files directly linked from this page)
-nd: don't create a directory structure, just download all the files into current directory.
grep -r
grep -ri -m1 '*.coffee'
amixer -D pulse sset Master 5%+
chown sirus:friends tmpfile https://www.thegeekstuff.com/2012/06/chown-examples/
sudo rm /var/lib/dpkg/lock sudo dpkg --configure -a
sudo rm /var/lib/apt/lists/lock sudo rm /var/cache/apt/archives/lock
sudo apt update sudo apt-get update
find . -type f -newermt 2010-10-07 ! -newermt 2014-10-08
sudo cp -vnpr /xxx/* /yyy
xxx = source
yyy = destination
v = verbose
n = no clobber (no overwrite)
p = preserve permissions
r = recursive
sudo find . -type f -newermt 2019-04-11 ! -newermt 2019-04-24 -exec scp -i /var/www/furtadosonline/furtadosonline.pem {} [email protected]:/webapps/ftp_uploads ;
Will copy after 11 and before 24 to the respective server. It will list all files even within sub-directories but wont create dir's on the uploading server.
Non recursive, files in this directory only:
sed -i -- 's/foo/bar/g' *
Sed command allows you to change the delimiter / to something else. So I am going to use +:
sed -i -- 's+foo+bar+g' *
View tmp size or clean it up older than 10 days files
df -k /tmp
sudo find /tmp -type f -atime +10 -delete
Getting the Size of a Directory top 5 files taking more space > https://linuxize.com/post/how-get-size-of-file-directory-linux/
sudo du -h /var/ | sort -rh | head -5
find /path/to/dir -type f -name "*" -newermt 2013-02-07 ! -newermt 2013-02-08
zip -r ../workspace.zip .
-x "/.git/*"
-x "/.DS_Store"
-x "/node_modules/*"
-x "/build/"
-x "**/dist/"
-x "/vendor/*"
-x "/target/"
-x "**/pycache/"
-x "/.venv/*"
-x "/bin/"
-x "**/_build/"
-x "/log/*"
-x "/temp/"
-x "/pubspec.lock"
-x "/.dart_tool/"
-x "/ios/Pods/*"
-x "/android/.gradle/"
-x "**/android/app/build/"
-x "/Lib/*"
-x "/lib/*"