A file system structure in which to store computer files.

learn more… | top users | synonyms

1
vote
1answer
35 views

copy files acoording to the correct directory

I have an issue in copying my file in my directories. in fact I have in a lot of directories .txt files and .jpeg files so I want to so I want to copy only the .txt file according to the directory for ...
-1
votes
3answers
46 views

How to access dot directory [on hold]

I’ve been googling on how to access dot directory in unix like system, but everybody is just talking about dot directories for this and that reason. I haven’t found anything on how to get to directory ...
1
vote
3answers
26 views

tar compresses folder, but creates nested structure

I have the following folders on a linux machine ./myFolder ./tmp ./packages ./zips compress.sh I run tar -czf ./zips/someFile.tar.gz ./tmp/someFolder from compress.sh. The folder is ...
7
votes
2answers
84 views

Keeping history per working directory (cf. per shell session)

Is there a way to make a modern shell's history feature be scoped to a path? My working contexts are split up as paths on the file system, and the pattern of shell activity, such as repeatedly issued ...
1
vote
4answers
183 views

Is it possible to execute a binary without specifying the full path or the preceding './'?

Outside of a shell, such as running some other process, what does the term current directory mean, and is it possible to execute a binary without specifying the full path or the preceding './', ...
1
vote
1answer
20 views

Strangeness with Symlinks and Relative Paths

Could someone please explain this to me? I'm having trouble understanding how this is set up and why it behaves the way it does. I wanted to see where zsh is actually installed on a machine that I ...
6
votes
5answers
190 views

How to execute a bash command in all possible subdirectories?

Let's say my main directory is /home/test Under it i have lots of subdirectories and under subdirectories still a lots of them and so on. Example: /home/test /home/test/subdir1 ...
2
votes
4answers
87 views

Why . /home/Desktop is incorrect and ./Desktop is correct?

I'm learning about Linux, started yesterday. I have a question which I couldn't answer from my book or Google. What is the difference between ./ and / in the shell? I'm asking this because when I ...
4
votes
5answers
87 views

command which works like ~ (tilde) symbol to represent some directory

cd ~/scripts. This will go into scripts directory in my home. Similar to this, I want some "alias" kind of setting, which will allow me to enter some other directory so that, cd xxx/mywork -> will ...
1
vote
1answer
65 views

How to list all leaf files under a directory in reverse time order?

Given a directory, how can we list all its leaf files in time reverse order? ls -Rltr ist the content of a subdirectory in time reverse order, but groups files by subdirectory, which break the ...
0
votes
2answers
24 views

Disable directory permissions change

I have a client whose website uses a plugin which creates a temp directory with 777 and I am being alerted by e-mail about it several times per minute. Since I do not want to add exception to the CXS, ...
9
votes
2answers
354 views

Is a directory removed when its number of hard links becomes 0?

Is a directory removed when its number of hard links becomes 0? A directory always has at least 2 as its number of hard links, because of .. When rm -r a directory, does it decrease the number of ...
3
votes
1answer
43 views

Timestamps of a directory?

About mtime of a directory, from Stéphane Chazelas's reply http://unix.stackexchange.com/a/187231/674 The modification time of a directory, like any other file (note how directories are called ...
-2
votes
0answers
48 views

creating new filesystem?

Is it possible to create directory/filesystem that would be beyond unix-like filesystem ( I mean "/" ) so when I will use command pwd , its output would be "example_folder" not "/example_folder" . I ...
2
votes
1answer
127 views

rm -rf: cannot remove `/opt/jetty': Directory not empty

I have a script using the following command to remove a folder: ssh -q root@hostname sh -c 'rm -rf /opt/jetty/' Most of the times it works fine, but occasionally I get this message: rm: cannot ...
2
votes
1answer
35 views

Shell Scripting: Deleting or moving files from one directory that match filenames from another directory

I have a very specific and odd problem to solve. I'm working as a research assistant and I've been producing a ton of figures. In one directory, I dump .pngs to view casually (limited space here) and ...
2
votes
3answers
126 views

tar unix not changing directory

I am executing a tar command to compress files which are present in another directory. I executed following command: tar -czf /backupmnt/abc.tar.gz -C /backupmnt/statusService/ * I want to create ...
4
votes
2answers
56 views

Prevent the Gtk file dialog from listing mount points

When I open the Gtk file dialog, there is a box called “Places” on the left-hand side which lists “Search”, “Recently Used”, a bunch of directories, and several things that appear to be volumes. I ...
1
vote
1answer
31 views

Mount host directory in a virtual machine

I have a directory on a system which is the host for a virtual machine. I want to make this directory accessible from the guest of the virtual machine. There are some way I can think of, packing the ...
2
votes
1answer
180 views

Why can't I remove the empty directory with username www-data? [duplicate]

The test is a directory which contains nothing, an empty directory. root@localhost:~# ls -l /home drwxrwxrwx 2 www-data www-data 4096 Apr 26 17:50 test root@localhost:~# ls -l /home/test ...
4
votes
2answers
92 views

Why does '/' have the inode 2?

On many *nix systems like OS X and Ubuntu, We can see the inode of root directory is 2. Then what is the inode 1 used for?
0
votes
1answer
17 views

Find out home directory of running Oracle instance

There are two oracle directories on our system: oracle oraclex How can I find out which of them is used by the running Oracle instance?
1
vote
2answers
27 views

Diff directories using modification time (mtime) and size instead of contents

Is there an option to have diff (-q) not look at file contents and instead just look at size and mtime? If not, is there a tool similar to this that has the option?
0
votes
3answers
38 views

How to count subdirectories in a directory in UNIX?

I have to count the total number of directories that are in the given directory (note that these are subdirectories). I know how to count for files but am having trouble counting the directories for ...
1
vote
1answer
60 views

Sticky bit and users with sudo permission

Let's say I chmod 1777 a folder /opt/test and all files inside it as user user1. Hence user2 is able to update and edit files inside the /opt/test directory. When user2 operates via sudo, he's able ...
14
votes
5answers
1k views

How is a directory a “special type of file”?

I am reading this Unix tutorial and came across this quote... We should note here that a directory is merely a special type of file. ...but no explanation or details are provided. How is a ...
2
votes
1answer
53 views

How to scan a directory with a space in its name with maldet

I'm trying to scan some directories with Linux Malware Detect (command-line command maldet): maldet -a /SOMETHING\ 1/ But I get: maldet(13857): {scan} invalid path /SOMETHING 1/ I've tried ...
1
vote
1answer
89 views

Bash script won't work on current directory

I'm using Kali linux which is based on Debian and wrote an script to copy some files from where the script is based to a specified directory. But when I execute my script (called CopyFiles.sh), cp ...
1
vote
0answers
19 views

Centos 7 FTP Hidden Directory Issue

After setting up Centos 7 with a web server standard install and LAMP stack. I installed vsftpd. Everything works fine and configured it to accept passive to enable gui ftp programs. However, when ...
0
votes
2answers
43 views

How do I run find, maxdepth and other commands on lcd while using ftp?

I have got the command working locally using normal commands. I now need it to run while using ftp. I understand I need to use '!' And instead of copy I will need to use put so it works on the lcd, ...
0
votes
1answer
38 views

Copy tree directory from specific point

I am now sure how to word this, but: I am copying all the newest .zip files each recursive sub directory inside this original folder: "/Users/Stu/Documents/Hoffi Work/FTP Backup Shell ...
8
votes
4answers
386 views

How do you check if a file exists within awk? [-d 'filename'] failing

I'm trying to generate a list of users who have a home directory set which does not exist. It seems I should be able to do this with awk, but something is wrong with my syntax. It keeps telling me ...
2
votes
1answer
45 views

Why does chmod succeed on a file when the user does not have write permission on parent directory?

I am trying to understand file/dir permissions in Linux. A user can list the files in a directory using cd test ls -l Even if the user issuing above commands does not have read, write or execute ...
0
votes
2answers
54 views

selectively moving partially matched files to different directories

I am working in linux server where a parent directory I has 100s of partially numbered files, e.g GGG12345_abb.txt GGG12346_abc.txt GGG12347_cbx.txt . . GGG19045_jha.txt each of which is ...
5
votes
6answers
98 views

Exclude directories in locate search

A search with locate finds paths in the filesystem. Often, you know a priori you are interested in either files only, or directories only. A 'locate' search often returns many results. It would be ...
21
votes
7answers
1k views

`command .*` acts on the parent directory

Someone of our team wanted to recursively change the user permissions on all hidden directories in a users home directory. To do so he executed the following command: cd /home/username chown -R ...
3
votes
3answers
70 views

Can a file be edited with the 'write' permission on it but not on its parent directory?

Suppose the owner/user doesn't have the write permission on a directory but he has it on a file under it. Can the file here be edited or not? If yes, is there any situation where the file cannot be ...
0
votes
0answers
37 views

rsync question about a directory

I went ahead and used rsync to back up a root directory called /files my exact commands werersync -avzh /files willc66@server.com:/backup, inside my /files directory I had 2 sub directories home and ...
2
votes
3answers
23 views

list all symbolic links to valid directories only with find

I can use find /search/location -type l to list all symbolic links inside /search/location. How do I limit the output of find to symbolic links that refer to a valid directory, and exclude both, ...
0
votes
1answer
26 views

. as a command line argument to a command running in background

I run grep some-string -r . &. While it is running in bkg, I cd to another directory. It seems that grep interprets the hard link . differently then. What happens before and after I change the ...
0
votes
1answer
26 views

Rename and copy/move sets of similar named directories to another location

For a set of directories with similar names at different location, /foldX/dirA with sub-directories aa1 aa2 aa3 aa4 aa5 /foldZ/dirA with sub-directories aa1 aa2 aa3 /foldY/dirA with ...
1
vote
1answer
47 views

How directory permissions remain same after mv command?

There are two user A & B. sharing same server. A has created a directory with permission 700 and both user and group are same i.e. user A e.g. drwx --- --- A A temp_dir/ Now user B has ...
1
vote
0answers
81 views

rm: Directory resources is not empty

I'm getting this kind of error when i'm deleting file on my AIX machine. Getting same error for rmdir. venky-19:[/hm/dev/application/backup/ear/] # rm -rf resources rm: Directory ...
2
votes
1answer
105 views

Uncompressing .tar.gz archive to specific directory

How does tar.gz file gets uncompressed with all contents to arbitrary directory, existing or not using tar using single line command? If it does not exists, then is created (directory). To clarify, ...
2
votes
1answer
24 views

Sandbox an account and prevent it from any system modifications

I am trying to sandbox a user account to the point where it cannot edit or view any files beyond a certain folder, namely /home/user/test. This account will be compiling and running a C++ program that ...
0
votes
2answers
50 views

Cut a string up to a certain character [closed]

I've searched the site and I've seen similar questions but I couldn't get them to work. I tried to follow: Splitting a string up to a specific location but it didn't work. I working with Korn. I ...
0
votes
5answers
306 views

How to get current working directory? [duplicate]

I want to have a script that takes the current working directory to a variable. The section that needs the directory is like this dir = pwd. It just prints pwd how do I get the current working ...
1
vote
2answers
146 views

Does change of a file in a directory not change the time of the directory?

I want to find a file which I created recently, but I don't remember anything and can only guess it is under a directory indirectly with any possible depth. I inspected the times of all the ...
2
votes
1answer
49 views

what is directory entry?

I have to use the dirent.h in some of my C projects. According to various different descriptions found online, I have come to a vague idea that directory entry is a data structure, which tells us ...
2
votes
1answer
35 views

When does adding `/` to a directory change its meaning?

When does adding / to a directory change its meaning? E.g. from Linux in a Nutshell: Transfer the entire directory proj to the /planning directory on remote host ourhub: $ rsync -r proj/ ...