All Tips


48

Tip #5  

Use && to run a second command if and only if a first command succeeds:

Read more »
  • TAGS:

46

Tip #78   network copy with ssh and tar

You can use ssh in conjunction with tar to pull an entire directory tree from a remote machine into your current directory:

ssh <username@sourcehost> tar cf - -C <sourcedir> . | tar xvf -

For example, let's say you have a "bsmith" account on a host called "apple". You want to copy those files into your "bobsmith" account on a host called "pear". You'd log into your "bobsmith@pear" account and type the following:

ssh bsmith@apple tar cf - -C /home/bsmith . | tar xvf -

This technique is useful when you have insufficient disk space on the source machine to make an intermediate tarball. Read more »

45

Tip #47   Changing file extensions

Rename replaces string X in a set of file names with string Y.

Read more »

32

Tip #205   Convert permissions to octal

Converts the symbolic permissions to octal (ie: numbers) when using 'ls -l':

Read more »

31

Tip #844   Hide files in an image

It is possible to hide a rar archive inside a png image file and then retrieve the files from this image.

Read more »

29

Tip #192   Print a random shell-fu tip

Print a random shell-fu tip:
Read more »

29

Tip #183   Always running

This checks if a daemon is running, if not it starts the daemon. Great for daemons that need to always be running. Can be used with cron

ps -C someprogram || { someprogram & }

// sil at infiltrated dot net Read more »
  • TAGS:
  • ps

27

Tip #216   Create a Terminal Calculator

Put the following in your .bashrc file

Read more »

26

Tip #858   Making shell scripts executable via editor hooks

If you spend a lot of time creating new shell scripts then it can be very useful to make them executable by default. To do this in Vim add the following lines to the end of your ~/.vimrc file - creating it if necessary:

Read more »