Saturday, March 28, 2015

Environmental variable in ubutnu mycat implementation


.   This directory or current directory

..   The parent directory

cd -        Change to previous directory

Usage: cd .
cd ..
There's output from my computer at the end of this post.

To display last working directory

echo $OLDPWD


cam@hack3r:~$ pwd
cam@hack3r:~$ cd /var/tmp
cam@hack3r:/var/tmp$ pwd
cam@hack3r:/var/tmp$ echo $OLDPWD
cam@hack3r:/var/tmp$ cd -
cam@hack3r:~$ pwd

How to implement your version of cat

question:why do i need to implement another cat version?
Ans: If you install java jdk or would know.
If you don't add into environmental path,then you can't run that program from other directories

cam@hack3r:~$ which cat

That executable is at /bin/cat
Click on computer browse through bin folder and you'll find cat(a diamond shaped file)
copy and paste it on Desktop;now rename it to mycat

cam@hack3r:~/Desktop$ ls
1  1~  2  2~  D  mycat  trytac.txt  Untitled Document~

cam@hack3r:~/Desktop$ mycat 1
No command 'mycat' found, did you mean:
 Command 'mmcat' from package 'sleuthkit' (universe)
 Command 'mlcat' from package 'svtools' (multiverse)
 Command 'mscat' from package 'libpwiz-tools' (universe)
 Command 'mcat' from package 'mtools' (main)
mycat: command not found

cam@hack3r:~/Desktop$ ./mycat 1
hi i'm in 1
i'm last line


cam@hack3r:~$ pwd
cam@hack3r:~$ cd /
cam@hack3r:/$ pwd
cam@hack3r:/$ cd /home/cam/Desktop/D
cam@hack3r:~/Desktop/D$ pwd
cam@hack3r:~/Desktop/D$ cd .
cam@hack3r:~/Desktop/D$ cd ..


Learn python for fun.The popular blog with questions and answers to the python.Solutions to facebookhackercup,codejam,codechef.The fun way to learn python with me.Building some cool apps.

No comments:

Post a Comment