Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> Strange output from a simple script. Noob looking for help
evltwins
post May 10 2016, 07:44 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 10-May 16
Member No.: 19,085



Hello all. I am currently taking Intro to Linux as part of my cyber security degree. I have posed a question about what I think is an issue to my professor but two days is about as long as I'll wait until I start looking for other help.

The script and the response is below. It's extremely basic. I've also attached the output I receive. Obviously, being a beginner to Linux, I have no clue what the displayed information means. It runs the script but then there is a ton of information that follows. Any help would be greatly appreciated.

[evltwins@fedori ~]$cat myscript
#!/bin/bash
echo -e "This is a sample tudent shell script."
echo -e "\t It displays mounted filesystems \a"
mount

Output:

[evltwins@fedori ~]$bash myscript
This is a sample tudent shell script.
It displays mounted filesystems
/dev/sda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,noexec,nosuid,nodev,rootcontext="system_u:
object_r:tmpfs_t:s0")
/dev/sdb1 on /home type ext4 (rw,noexec,nosuid,nodev,usrjquota=aquota.user,
jqfmt=vfsv0)
/dev/sda5 on /tmp type ext4 (rw,noexec,nosuid,nodev)
/dev/sda6 on /var type ext4 (rw,noexec,nosuid,nodev)
/dev/sdc1 on /groups type ext4 (rw,noexec,nosuid,nodev)
/dev/sda3 on /var/log type ext4 (rw,noexec,nosuid,nodev)
/tmp on /var/tmp type none (rw,nosuid,nodev,bind)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sda2 on /common_pool type ext4 (rw,noexec,nosuid,nodev,usrjquota=aquot
a.user,jqfmt=vfsv0)

I have a second script as part of this assignement that is nearly identical:

[evltwins@fedori ~]$cat myscript2
#!/bin/bash
echo -e "This is a sample shell script. \t It displays mounted filesystems
. \a"
mount

Output:

[evltwins@fedori ~]$bash myscript2
This is a sample shell script. It displays mounted filesystems.
/dev/sda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,noexec,nosuid,nodev,rootcontext="system_u
:object_r:tmpfs_t:s0")
/dev/sdb1 on /home type ext4 (rw,noexec,nosuid,nodev,usrjquota=aquota.user
,jqfmt=vfsv0)
/dev/sda5 on /tmp type ext4 (rw,noexec,nosuid,nodev)
/dev/sda6 on /var type ext4 (rw,noexec,nosuid,nodev)
/dev/sdc1 on /groups type ext4 (rw,noexec,nosuid,nodev)
/dev/sda3 on /var/log type ext4 (rw,noexec,nosuid,nodev)
/tmp on /var/tmp type none (rw,nosuid,nodev,bind)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sda2 on /common_pool type ext4 (rw,noexec,nosuid,nodev,usrjquota=aquo
ta.user,jqfmt=vfsv0)
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies (1 - 1)
michaelk
post May 11 2016, 08:24 AM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,797
Joined: 23-January 03
Member No.: 360



Welcome to linuxhelp.

Not exactly sure about the purpose of the assignment but I would guess it is all about learning the echo command and not about what is displayed in the output of the mount command. To see more information about echo you can type

man echo

You can use the arrow keys to advance to the next line as well as pressing the space bar to go to the next page. To exit the man page press the q key.

If you do not understand partitions and filesystems the output might look very confusing. Partitioning is a way to split the drive into sections as a way to organize data. In order to access data easily the partitions are formatted with a filesystem. Windows uses NTFS, FAT32 and exFAT while linux has lots of options. Fedora defaults to ext4. In order to access the filesystems they have to be "mounted". That is the purpose of the mount command (see man mount). Just typing the mount command outputs information about what partition, where it is mounted (a directory) its permissions and other specific options and type of filesystem.

For example.
/dev/sda1 on / type ext4 (rw)

/dev/sda1 - sda is the first drive and 1 is the first partition. It is mounted as / which is the root partition. The type of file system is ext4 or extended filesystem version 4. (rw) means read/write permissions.

proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)

These are special virtual filesystem which only exist in RAM. You should learn about these but it is probably just going to confuse you at the moment.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th October 2017 - 06:20 AM