Skip to main content

Command line

12th October, 2022

Updated: 13th October, 2022

Generate a new SSH key

source

ssh-keygen -t rsa -C "your_email@example.com"

SCP File transfer

scp xxx.blah name@ip:/home/blah/xxxxx

Get ssh-agent to run

eval ssh-agent bash
ssh-add ~/.ssh/

ps -e | grep [s]sh-agent
eval ssh-agent bash
ssh-add -l

Tar and UnTar

Unzip tar –zxvf file.tar

Zip tar –zcvf file.tar /folder/path

Symlinks

source: 'How can I symlink a file in Linux? - Stack Overflow'

in the folder you want to link from eg courses/ and data is in /STAGE

REMOVE EXISTING FOLDER

rm -rf foldername

ln -s original course123

ln -s /home/user/webs/scorm_courses/STAGE/x course123

ln -s EXISTING_FILE SYMLINK_FILE

Cron

View Crons

crontab -l

edit crons

crontab -e
# m h  dom mon dow   command
0,10,20,30,40,45,50,55 * * * * wget -q http://www.wordpresssite.org/cron.php > /dev/null && rm cron.php >/dev/null 2>&1

Determine total directory/folder file size'

The command du "summarizes disk usage of each FILE, recursively for directories," e.g.,

du -hs /path/to/directory

-h is to get the numbers "human readable", e.g. get 140M instead of 143260 (size in KBytes) -s is for summary (otherwise you'll get not only the size of the folder but also for everything in the folder separately)

http://askubuntu.com/questions/1224/how-do-i-determine-the-total-size-of-a-directory-folder-from-the-command-line

For a quick view:

du | sort -n

lists all directories with the largest last.

du --max-depth=1 * | sort -n

or, again, avoiding the redundant * :

du --max-depth=1 | sort -n

Links

File management

Git browsing

oh-my-zsh

  • zgen plugin manager for zsh

email

productivity

video

chat

reading


16407542-4697-4a61-85b8-b2e4cb23368a

Created on: 12th October, 2022

Last updated: 13th October, 2022