Help

Dozens of commands to manage unix file system.

Files

Empty file

< > file>

Show file size

<ls -sh solr.log>

Nano file with line number

<nano -c [filename]>

Number of lines in directory file with line number

<find -name '*.rb' | xargs cat | wc -l>

Number of files in directory

<find -type f -printf . | wc -c>

Split file

<sudo split --bytes=1M frwiki-20140608-abstract5.xml /home/aggounix/Téléchargements/wiki>

Disc usage

< sudo du -sh /dir/*>

Move File/Directory

<sudo mv /dir1 /dir2>

Transfer files

<scp -rpC dump.rdb root@ns309835.ip-94-23-25.eu:/home/root/redis>

Redis

Start Redis

< redis-server /etc/redis/redis.conf>

Save Bkg Redis

< sysctl vm.overcommit_memory=1> < vm.overcommit_memory=1>

Cannot assign requested address

< echo 1 | sudo tee /proc/sys/net/ipv4/tcp_tw_reuse > < echo 1 | sudo tee /proc/sys/net/ipv4/tcp_tw_recycle >

Memory

Top process

< top -b -n 1>

Display the top ten running processes - sorted by memory usage

< ps aux | sort -nk +4 | tail>

SSH

Add key to server

< cat ~/.ssh/id_rsa.pub | ssh user@123.45.56.78 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys">
--- !ruby/hash-with-ivars:ActionController::Parameters
elements:
  controller: homes
  action: unix
ivars:
  :@permitted: false