**It's a tutorial problem in a Linux course**:
The command
-la /
gives this result:
total 72
drwxr-xr-x 19 root root 4096 Apr 15 23:39 .
drwxr-xr-x 19 root root 4096 Apr 15 23:39 ..
lrwxrwxrwx 1 root root 7 Jan 28 22:23 bin -> usr/bin
drwxr-xr-x 4 root root 4096 Jan 28 22:30 boot
drwxr-xr-x 18 root root 3320 Apr 15 23:24 dev
drwxr-xr-x 73 root root 4096 Apr 15 23:24 etc
drwxr-xr-x 4 root root 4096 Feb 5 20:55 home
lrwxrwxrwx 1 root root 7 Jan 28 22:23 lib -> usr/lib
drwx------ 2 root root 16384 Jan 28 22:23 lost+found
drwxr-xr-x 3 root root 4096 Jan 28 22:23 media
drwxr-xr-x 2 root root 4096 Jan 28 22:23 mnt
drwxr-xr-x 2 root root 4096 Jan 28 22:23 opt
dr-xr-xr-x 133 root root 0 Apr 15 23:24 proc
drwx------ 5 root root 4096 Apr 15 23:47 root
drwxr-xr-x 17 root root 520 Apr 15 23:25 run
lrwxrwxrwx 1 root root 8 Jan 28 22:23 sbin -> usr/sbin
drwxrwxrwx 3 root root 4096 Apr 15 23:40 something
drwxr-xr-x 2 root root 4096 Jan 28 22:23 srv
dr-xr-xr-x 13 root root 0 Apr 15 23:24 sys
drwxrwxrwt 8 root root 4096 Apr 15 23:47 tmp
drwxr-xr-x 11 root root 4096 Jan 28 22:23 usr
drwxr-xr-x 11 root root 4096 Jan 28 22:23 var
The command ls -lR /something
produces this result:
/something:
total 4
drw-r-xr-x 3 george george 4096 Apr 16 14:24 one
/something/one:
total 4
drwxr-xr-x 2 george george 4096 Apr 15 23:47 two
/something/one/two:
total 4
-rwxrwxrwx 1 george george 7 Apr 15 23:47 somefile
We work under the user
, i.e. the command
gives us
. The george
command gives us the result : george users
.
What result do we get for the /something/one/two/somefile
command and why?
**My attempt to solve the problem**:
**1. Let's see what access rights we have to somefile:**
The file
has -rwxrwxrwx
rights, hence the users **user, group and other** have all the rights to read, write and execute this file.Hence, the user **george** can read this file.
**2. Let's make sure that somefile exists:**
Running the ls -lR /something
command displays a list of all files and subdirectories in the /something
directory, including permissions information and file size, with superuser privileges. The file is located in the /something/one/two/somefile
directory.
**3. Let's check the access rights of the directory /something/one/two/somefile :**
Directory
has access rights -r-xr-x
- user **george** has permission to enter this directory, and read the contents;
Directory
has -xr-x
access rights - user **george** has permission to enter this directory, and to read the contents;
By executing the /something/one/two/somefile
command we will be able to view the contents of the
.
The -l
command shows that the ``somefile
` file weighs 7 bytes. If the file contains text or characters, they will be displayed in the console.
**My mentor says these hypotheses need to be tested.**
**How do I test this task?**
Asked by KukuruzoFirst
(3 rep)
Nov 25, 2024, 10:09 PM