ping -i 60 -a ADDRESS
gnu
uname -a
grep flags /proc/cpuinfo
lscpu
sudo lshw -short
hwinfo --short
darwin
system_profiler
sysctl hw
- Generate SSH KEY in client
ssh-keygen -t rsa
- Copy the client .pub
cat ~/.ssh/id_rsa.pub
- Paste in server
cat ~/.ssh/id_rsa.pub | ssh user@machine “mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys” || ssh-copy-id user@host
- Restart ssh service in server
/etc/init.d/ssh restart || service sshd restart
sudo lsof -i | grep LISTEN
find . -name "name*"
just dir
find . -name "name*" -d
just last X day(s)
find . -mtime -2
find . -name ".git*" -exec rm -r "{}" \;
du -hs *
who
w
scp -r user@place:/file_or_dir /to/file_or_dir
digits
grep -r '[0-9][0-9]' /dir && grep '[0-9][0-9]' /file
blank lines
grep -r '^$' /dir && grep '^$' /file
Foo foo FOO FoO..
grep -r '[fF][oO][oO]$' /dir && grep '[fF][oO][oO]$' /file
ssh -N -LX:localhost:Y machine YOUT LOCAL ON 80 TO 3000 http://localhost->http://localhost:3000
ssh -N -L3000:localhost:80 localhost
local
diff /foo /bar
external
ssh user@host cat /path/to/remotefile | diff /path/to/localfile –
ls -alh
tail -f /file
tail -200 /file
tail -200 /file
ln -s /dir to-dir
last -20 user name-user
tar -cvf output.tar /dirname || tar -cvf output.tar /dirname1 /dirname2 filename1 filename2 || tar -cvf output.tar /home/vivek/data /home/vivek/pictures /home/vivek/file.txt || tar -cvf /tmp/output.tar /home/vivek/data /home/vivek/pictures /home/vivek/file.txt
tar -tvf /tmp/data.tar
tar -xvf /tmp/data.tar || tar -xvf data-backup.tar resume.pdf || tar -xvf data-backup.tar pic1.jpg file1.doc foo.movf
- c : Create a tar ball.
- v : Verbose output (show progress).
- f : Output tar ball archive file name.
- x : Extract all files from archive.tar.
- t : Display the contents (file list) of an archive.
df
diff foo.txt bar.txt
du -h
finger
top -l 1 -s 0 | awk ' /Processes/ || /PhysMem/ || /Load Avg/{print}'
halt
shutdown -r now
halt
history | tail -10
USER AGENT TEXT MODE ( ON MAC SEE: lynxlet )
lynx
uptime
expr 1+1
look car
yes "Hello bich"
tac file.txt
lsof -i :80
lsof -P | grep ':3000' | awk '{print $2}' | xargs kill -9
ps auxwww | grep postgres
sudo launchctl list | grep post
sudo lsof -i -P | grep -i "listen"
netstat -lptu OR netstat -tln
ps -ef | pgrep -f "cypress" | xargs kill -9 # killall cypress
list used ports: