Intern
26. How to find out the current working directory? - ll; - who; - uname -a; - pwd; 27. On the server, there is a directory containing a subdirectory, which in turn contains a file. You are the owner of everything recursively (/dir/dir/file), and the group is also yours. If you try to read the file with your user, the console returns a permission denied message. What is missing? - The x bit in one of the directories; - Root user rights; - Read permission for the file; - Possibly only if the file is executable; 28. What data streams do you know in Linux?
sobes.tech AI
Answer from AI
- The current working directory can be found using the command
pwd(print working directory). It outputs the full path to the directory you are currently in.
ll— this command provides a detailed list of files in the directory.who— shows who is currently logged into the system.uname -a— displays system information.
-
If you get "permission denied" when trying to read a file, even though the owner and group are set correctly, it is likely that you lack execute (
x) permission for one of the directories in the path. In Linux, to access a file, you need to havexpermission on all directories in the path to be able to "pass through" them. -
In Linux, there are three main data streams for processes:
- stdin (standard input) — the stream from which the process reads data (usually the keyboard).
- stdout (standard output) — the stream to which the process outputs data (usually the screen).
- stderr (standard error stream) — the stream for outputting error messages.
These streams can be redirected to control input and output of programs.