Linux concepts by durga soft
1.Create 10 directories and 5 files in each directory
A. mkdir dir{1..10} && touch dir{1..10}/file{1..5}
2.Open 2 terminals parallely and redirect output to from one terminal to other
A. In linux every thing is tretaed as a file.So get the file corresponding to current terminal using tty command in terminal 1 and redirect ouput from terminal 2 to terminal 1
a)Open 2 terminals, either ssh sessions or 2 terminals
b)Execute tty command in terminal 1, it will display file corresponding to current terminal session
Eg:/dev/pts/1
c)switch to terminal 2 and execute below command
echo "This is sample text" >> /dev/pts/1
d)now you can observe the ouput will be redirected to terminal 1
3. Difference between mnt and media in linux file system, which is used for mounting
If you plug in an external device it is generally automatically mounted in /media. Doesn't make any difference that I know of where you decide to create the mount point, but others may have very good reasons for doing one or the other.I leave /media alone, personally. You could, theoretically, create a mount point in /home and mount there if you want. Doesn't make a lot of difference.
For me, anything mounted in /mnt is done so manually. Anything mounted in /media happens automatically. Save me confusion.
Comments
Post a Comment