$! 1 bash: 1: command not found $!1 bash: !1: event not found $!+1 bash: !+1: event not found $!-1 ! 1 bash: 1: command not found $!! ! 1 bash: 1: command not found $!-0 bash: !-0: event not found $
Author Archives: jeffrin
getting choices listed directly with the first TAB
$p Display all 428 possibilities? (y or n) $p bash: p: command not found $cat .inputrc set show-all-if-ambiguous on $ related text: Specifies the duration Readline will wait for a character when reading an ambiguous key sequence (one that can form a complete key sequence using the input read so far, or can take additional …
Continue reading “getting choices listed directly with the first TAB”
enclose one or more commands inside a pair of parentheses
$ls 1 $( ls date ) ls: cannot access date: No such file or directory $( `ls` date ) bash: 1: command not found $cat 1 B$ $( ls `date` ) ls: cannot access Mon: No such file or directory ls: cannot access Feb: No such file or directory ls: cannot access 22: No such …
Continue reading “enclose one or more commands inside a pair of parentheses”
sample interaction with bash shell from the GNU project
$echo $BASH /bin/bash $echo $BASH_ $echo $BASH_v $echo $BASH_VERSION 4.3.42(1)-release $date || time Sun Feb 21 23:15:50 IST 2016 $datei || time bash: datei: command not found real 0m0.000s user 0m0.000s sys 0m0.000s $dateno || time bash: dateno: command not found real 0m0.000s user 0m0.000s sys 0m0.000s $time || date bash: syntax error near unexpected …
Continue reading “sample interaction with bash shell from the GNU project”
the need of a command named “builtin”
$builtin echo jeffrin jeffrin $echo jeffrin jeffrin $echo() { echo “hi”; }; $echo jeffrin ^C $builtin echo jeffrin jeffrin $echo jeffrin ^C $ https://en.wikipedia.org/wiki/Shell_builtin http://unix.stackexchange.com/questions/11454/what-is-the- difference-between-a-builtin-command-and-one-that-is-not (jeffrin) what is the use of the command named “builtin” (jeffrin) llua : hello (llua) to avoid a possible wrapper
a session with tsort command involving topological sorting
$tsort 1 tsort: -: input contains an odd number of tokens $tsort 1 2 1 2 $tsort 0 1 2 3 4 5 0 2 4 1 3 5 $tsort 0 1 2 3 4 5 0 2 4 1 3 5 $ http://www.geeksforgeeks.org/topological-sorting/ https://www.quora.com/What-are-some-real-world-applications-of-topological-sort
A typical hack with strace command which traces a ping command
ABOUT strace strace is a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor and tamper with interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as ptrace. TYPICAL strace …
Continue reading “A typical hack with strace command which traces a ping command”
sample session involving “env” and “unset” commands
ABOUT env env is a shell command for Unix and Unix-like operating systems. It is used to either print a list of environment variables or run another utility in an altered environment without having to modify the currently existing environment. Using env, variables may be added or removed, and existing variables may be changed by …
Continue reading “sample session involving “env” and “unset” commands”
how to backup and restore file permissions using acl
$mkdir data $cd data/ $ls $pwd /home/jeffrin/data $echo hello > file1.txt $echo world > file2.txt $ls -l total 8 -rw-r–r– 1 jeffrin jeffrin 6 Jan 22 22:44 file1.txt -rw-r–r– 1 jeffrin jeffrin 6 Jan 22 22:44 file2.txt $getfacl -R . > permissions.txt $cat permissions.txt # file: . # owner: jeffrin # group: jeffrin user::rwx group::r-x …
Continue reading “how to backup and restore file permissions using acl”
simple hack using the “join” command
$cat name.txt 1 ram 2 shyam 3 raju 4 biju $cat company.txt 1 google 2 facebook 3 twitter 4 ibm $join company.txt name.txt 1 google ram 2 facebook shyam 3 twitter raju 4 ibm biju $join name.txt company.txt 1 ram google 2 shyam facebook 3 raju twitter 4 biju ibm $