CharlyBr on Sep 11th, 2008The unix touch command
This post is a quick ref on the linux touch command. All the examples have been tested on Linux.
This command is used to update the access and modification times of files.
touch’s syntax
touch [option] file_name(s)
touch file1 file2 file3
Here some examples:
# touch /tmp/file
# ls -l /tmp/file
rw-r–r– 1 charlybr charlybr 0 Sep 10 16:13 /tmp/file
Update access and modification [...]
CharlyBr on May 23rd, 2008Retrieve file from svn
Sometimes you need to retrieve a single file from SVN without doing a checkout on the repository.
SVN provides the svn cat to output the content of a file. You can redirect the output to get the file as :
svn cat https://svn.mydomain.com/project/folder/file.ext > file.ext
You can also use a simple shell script to do the work :
$ [...]
CharlyBr on May 7th, 2008Automatically set title on iTerm tabs
If like me you use iTerm for your terminal sessions, this is the tips to dynamically set the tab title.
As I’m using the bash shell, the tab title can be automatically set with the PROMPT_COMMAND variable. You can set this variable in /etc/profile or in your .bashrc
Mine is like this :
export PROMPT_COMMAND=’echo -ne “\033]0;${USER}@${HOSTNAME%%.*}\007″‘
The content [...]
CharlyBr on May 2nd, 2008Command line history
As read here, this is my command line history on my MacBook :
$ history 1000 | awk ‘{a[$2]++}END{for(i in a){print a[i] " " i}}’ | sort -rn | head
240 ssh
62 cd
55 scp
33 for
28 vim
25 ping
17 history
13 ls
4 sudo
3 telnet