Tech.Linux History
Hide minor edits - Show changes to output
Changed line 45 from:
!! top 10 process using the most memory:
to:
!! Top 10 process using the most memory
Added lines 43-47:
(:sourceend:)
!! top 10 process using the most memory:
(:source lang=bash :)
ps aux --sort=-%mem | awk 'NR<=10{print $0}'
!! top 10 process using the most memory:
(:source lang=bash :)
ps aux --sort=-%mem | awk 'NR<=10{print $0}'
Changed lines 38-43 from:
It will list files having a size > 4000k in /.
to:
It will list files having a size > 4000k in /.
!! List installed packages
(:source lang=bash :)
dpkg -l | grep '^ii'
(:sourceend:)
!! List installed packages
(:source lang=bash :)
dpkg -l | grep '^ii'
(:sourceend:)
Changed lines 32-38 from:
It will give the top ten of big folders sorted by size (in Mb) descending.
to:
It will give the top ten of big folders sorted by size (in Mb) descending.
!! Find big files
(:source lang=bash :)
find /-size +4000k -exec ls -lia {} \;
(:sourceend:)
It will list files having a size > 4000k in /.
!! Find big files
(:source lang=bash :)
find /-size +4000k -exec ls -lia {} \;
(:sourceend:)
It will list files having a size > 4000k in /.
Added lines 27-32:
!! Find big folders in a file system
(:source lang=bash :)
du -hms /* | sort -nr | head
(:sourceend:)
It will give the top ten of big folders sorted by size (in Mb) descending.
Changed line 9 from:
It will forward all incoming data from localhost:2080 to webserver.org:80.
to:
It will forward all incoming data from localhost:13306 to server.org:3306.
Added line 11:
%center%Path:/demarey/pmwiki/images/ssh-tunneling.png"ssh-tunneling"
Added lines 20-24:
(:sourceend:)
!! List open ports
(:source lang=bash :)
netstat -lnptu
!! List open ports
(:source lang=bash :)
netstat -lnptu
Changed lines 18-20 from:
to:
(:source lang=bash :)
find . -name Makefile | xargs grep pattern
(:sourceend:)
find . -name Makefile | xargs grep pattern
(:sourceend:)
Changed lines 14-18 from:
(:sourceend:)
to:
(:sourceend:)
!!How to search a pattern in a set of files
The best option is to use find to construct the set of files and then use grep.
find . -name Makefile | xargs grep pattern
!!How to search a pattern in a set of files
The best option is to use find to construct the set of files and then use grep.
find . -name Makefile | xargs grep pattern
Changed line 7 from:
ssh -L 2080:localhost:80 user@webserver.org
to:
ssh -L 13306:localhost:3306 user@server.org
Added lines 10-14:
Some web servers are only available through a gateway. To access it from your computer, you can also use a SSH tunnel:
(:source lang=bash :)
ssh -L 8080:webserver:80 gw
(:sourceend:)
Added lines 1-9:
!!How to set up an SSH tunnel?
(:source lang=bash :)
ssh -L [tunnel-in-port]:[client-host]:[tunnel-out-port] [user@host-to-reach]
(:sourceend:)
Example:
(:source lang=bash :)
ssh -L 2080:localhost:80 user@webserver.org
(:sourceend:)
It will forward all incoming data from localhost:2080 to webserver.org:80.
(:source lang=bash :)
ssh -L [tunnel-in-port]:[client-host]:[tunnel-out-port] [user@host-to-reach]
(:sourceend:)
Example:
(:source lang=bash :)
ssh -L 2080:localhost:80 user@webserver.org
(:sourceend:)
It will forward all incoming data from localhost:2080 to webserver.org:80.