Wednesday, June 22, 2011

Ubuntu: dd Command

Note: To test this out sometime later
dd if=<source> of=<target>


Duplicate sda2 into sdb2 

dd if=/dev/sda2 of=/dev/sdb2 bs=4096 conv=notrunc,noerror

Fixing old hard drive:
Code:
dd if=/dev/sda of=/dev/sda

Ubuntu: Navigating folders and directory commands in Terminal

Initial line in Terminal. Note that ~ represents the Home Folder.
username@machinename:~

To know your current working directory:

username@machinename:~$ pwd
home/rootfolder 


To know the list of items inside the path (or can also use command dir):
username@machinename:~$ ls
Folder1  Folder2  Folder3

To change directory:
username@machinename:~$ cd Folder1 
username@machinename:~/Folder1$
To return back to Home Folder:

username@machinename:~/Folder1$ cd ~ 
username@machinename:~$


To go to root filesystem:
username@machinename:~$ cd /
username@machinename:/$ ls 
bin    dev   initrd.img  media  root     srv  usr
boot   etc   lib         mnt    sbin     sys  var
cdrom  home  lost+found  proc   selinux  tmp  vmlinuz

To go up one level (notice there is a space, unlike in DOS where it is "cd.."):
username@machinename:/media$ cd ..
username@machinename:/$


To go up one level and to a specific folder name in that directory:

username@machinename:/media$ cd ../boot
 username@machinename:/boot$