A file system structure in which to store computer files.

learn more… | top users | synonyms

6
votes
2answers
232 views

How does one create a directory that can't be seen and can only be accessed via its absolute path name?

I'm working on an assignment on adding time support to a standard UNIX system. Part of it, however, involves securing the location of backup files (which we've set to be at the system root by default) ...
3
votes
1answer
71 views

Where does ext4 store directory sizes?

Where does ext4 store directory sizes? Are they stored in the directory inode? For example, when I run du -h, it returns directories' size instantly, so I don't believe it calculates it at that time. ...
7
votes
6answers
1k views

Is it possible to remove folder prefix from a `ls` command

I am in a bash script and I want to get the list of all files (let say all jar files). I execute the command ls -1 lib/*.jar and I get the output: lib/mylib_1.jar lib/mylib_2.jar ... Is there any ...
16
votes
6answers
2k views

Why do I have to cd out of a deleted directory?

On my server I have a directory structure looking something like this: /myproject/code I normally have an ssh connection to the server and 'stand' in that directory: root@machine:/myproject/code# ...
1
vote
2answers
157 views

Create a user that can only connect to a specific directory

I've created a SSH folder for some friends. I've created the users to log in via SSH, but they connect to ~ how can I set to which folder they can connect? I have a directory called /usbdrv/ which ...
2
votes
1answer
224 views

inotifywait not working when folder is deleted and re-created

I am trying to use inotifywait to monitor a folder: inotifywait -m -r /home/oshiro/Desktop/work_folder The command works and if I create files in that folder, all seems to work correctly. While ...
1
vote
1answer
111 views

List files, directories and executables in current directory

I have php shell and I have function that do just that (but it give me error when I call scandir($path) function because of restriction in php), so I need to use my bash shell to do the same. It can ...
0
votes
1answer
104 views

Mount a dropbox directory without installing the dropbox application

This is most likely to be a duplicate question, but I could not find a simple answer for my problem. My situation is as follows: I have multiple accounts on different computing clusters. I want to ...
2
votes
1answer
322 views

Open multiple directories in different tabs in the same window in CentOS

How can I set my CentOS to be able to open multiple directories in different tabs in the same window? I have already enabled the feature to open the folders in the same window, but this is different: ...
1
vote
2answers
102 views

What is ~/default used for? [closed]

When I connect to my server using a the shell provided by Capistrano it executes ~/default before every command. I can't find out if this is Capistrano related or if this file has some generic use ...
2
votes
2answers
380 views

Symlink all subdirectories in a directory to another directory

I'm trying to symlink every directory in a folder to another folder. For example, in the structure below, I need the subfolders symlinked to folder2. - /home/chris/folder1 -- subfolder1 -- subfolder2 ...
1
vote
2answers
133 views

moving files of certain formats from subdirectoris to directories with same folder names

I’ve got a weird situation. I have 100s of folders with flac and mp3 copies of the same tracks. I need to separate the mp3s from the flacs and put them into similarly named directories. for example: ...
5
votes
3answers
221 views

extracting to a directory other than the current directory with pax archiver

I have a strange behaviour with the pax archiver here, had too much troubles with tar and it's absolute path, that's why I gave pax a shot. The below oneliner is used under FreeBSD 9.2 to extract ...
6
votes
1answer
101 views

Expected behavior of `find -depth` if execute permission denied for subdirectory?

I'd like to know if I can rely on the behavior I am seeing when using find with -depth option and user does not have execute permission for a subdirectory. Assume the following directory structure: ...
1
vote
1answer
196 views

cp /etc/DIR_COLORS ~/.dir_colors not responding

I'm using CentOS 6.5 and Putty. My problem is that directory file names are shown in dark blue color which is hard to read. I google searched and found this link; basically it's copying the DIR_COLORS ...
2
votes
4answers
108 views

Wrapper command that runs program in temporary directory and deletes it after execution [duplicate]

I want to write a command that: takes another command as its arguments does a 'cd' to a temporary folder executes the command passed in the arguments removes the temporary folder afterwards ...
1
vote
1answer
41 views

Find which directories each group can access

I need to take the /etc/group file (RHEL) and check what high level subdirectories each group has access to. Here is a made up example: Group 100 - \xxx\xxx\xxx Group 150 - \xx\xxxxx\x Is that ...
1
vote
2answers
218 views

LINUX: How to calculate recursively the size of each sub directory up to root directory?

I have written this script Scrit in Linux. I now need to know the size for each sub directory with the condition -atime +${DAYS} searching down from directory $DIR. The result should be gathered in ...
3
votes
3answers
307 views

Transform a directory into file or a file into directory

I wanted to create a file named test. Accidentally I run mkdir test instead of touch test. Is it possible to convert test directory in a file named test? What about converting a file named test into ...
4
votes
2answers
482 views

Where is a shell script run from?

I have a shell script in /usr/bin. Let's call it hello. It contains this: echo "I am located in $PWD" echo "I am called from this directory: ???" Running hello from /home/Documents I expect the ...
-2
votes
2answers
71 views

List the file permissions of only the current directory [duplicate]

ls -la . will show this in it: insgesamt 1312 drwxrwxr-x 6 ruben rubo77 4096 Feb 23 06:20 . drwxrwxr-x 23 ruben rubo77 4096 Feb 6 21:48 .. ... But it will show the whole content of the ...
5
votes
2answers
3k views

Getting new files to inherit group permissions on Linux

I am having a problem with permissions on a Linux server. I am used to BSD. When a directory is owned by a group the user who owns it isn't in such as www-data, files created in it will be owned by ...
1
vote
3answers
653 views

What makes the files in my home directory appear, when I log in through SSH then run ecryptfs-mount-private?

I'm a bit of a newbie when it comes to using Linux. I've recently installed Ubuntu 12.04 LTS (minimal virtual machine) on a VPS host. I've encrypted the virtual disk and encrypted the home directory ...
4
votes
1answer
218 views

Tab completion of “../” in zsh

One noob question from a new zsh user: In bash, I can use tab-completion to move one directory up and descend down again another path. For example, suppose I'm in $HOME/folder1, and I want to cd to ...
2
votes
2answers
35 views

Specialized access control for directories in RedHat

I have a requirement where I want to change permissions for a directory so that the directory owner (user/group) would be able to create files inside the directory and modify them, but won't be able ...
0
votes
2answers
779 views

How can I concatenate all files in a directory together in one command line operation? [duplicate]

I have 1000 csv files in a directory. I would like to concatenate them all together in order. They are named img_size_1.csv to approx img_size_1000.csv This answer is close but assumes a list file. ...
1
vote
1answer
61 views

Using SUDO to execute a general command inside a non-accessible directory

I want to grep something inside a directory. But the user dont have permissions in the direcotry. Because of some reasons, i am not allowed to change permissions, group or owner. Just want to know i ...
2
votes
4answers
129 views

cd two levels down from root

I'm a web developer (Drupal mainly). When I develop websites I do so within a /workspace folder. So I have folders like this. /workspace/project/ /workspace/project/sites/default/files/ ...
3
votes
1answer
275 views

ls -l --group-directories-first (act on symlinks as well)

ls option --group-directories-first causes directories to be listed on the top, which makes the output of ls nice and clean: ls -l --group-directories-first However, it does not act on symlinks, ...
2
votes
2answers
113 views

set umask (permissions) similarly as setgid on a directory

I know how to use setgid on directories, to enforce that whole directory structure has uniform user:group ownership. Is there a similar way to set the umask for a directory, so that the whole ...
1
vote
1answer
65 views

How to open a directory and save code in it Gerris in Linux?

I am new to this Unix and Gerris (software) world. I have to simulate. but I cannot open and type these codes below in vortivcity directory.I am using remote connection from mac to university machine. ...
2
votes
1answer
40 views

Confusion on the cp command when creating a new directory

Let me explain my problem with a simpler scenario. We have these two directories: ~/Foo and ~/Bar. Foo contains the files test1.txt and test2.txt. If I run the command cp -R Foo Bar, the Bar directory ...
2
votes
3answers
112 views

Why can't I edit links and directories directly?

There are programs such as hexedit that allow one to edit each bit of a file, and as I keep hearing that in Unix "everything is a file", I tried to edit some directory, expecting bytes referring to ...
4
votes
3answers
669 views

find with execdir

I run a find with execdir both I don't get the results I was expecting. SSCCE below: mkdir -p a/b/c find . -type d -execdir touch foo \; $ tree a a ├── b │   ├── c │   └── foo └── foo Directory c ...
2
votes
0answers
66 views

How to restrict directory name creation to pattern?

I have FreeNas CIFS share. Mount command result: /dev/ufs/VSPHERE on /mnt/VSPHERE (ufs, NFS exported, local, soft-updates, nfsv4acls) I want to restrict users from creating directories that do not ...
2
votes
2answers
94 views

can I get the shell to decide ls or less depending on filetype?

Very often I find myself looking through directories using 'ls', then when I find the file I want, I use 'less' to look at the file. So for example to find a mysql log file I might type ls /var ...
2
votes
3answers
1k views

Can't cat a file or make a directory: contradictory output?

I am getting output from a terminal in Ubuntu 12 that I don't understand. $cat sublime no such file or directory $mkdir sublime cannot create directory 'sublime': File exists How can both of these ...
2
votes
2answers
432 views

Is a -rw-rw-rw- file really inaccessible inside a drwxrwx— directory?

Say I have a directory with these permissions: drwxrwx--- Inside this directory, a file with these permissions: -rw-rw-rw- Is the file readable/writable by everyone or not ? If not, how secure ...
2
votes
1answer
101 views

What is the tmp folder in /var?

I have a tmp folder in /var and it has the file channel.xml in it. I don't know what this is and if it should be there and what permissions it should have because at the moment it is wide open. Also ...
8
votes
1answer
1k views

Can rm recursively remove empty directories?

In an old version of Unix, the rm command would delete directories if they were empty. From the Research Unix Eighth Edition man page for rm: "If an entry is a directory it is removed only if empty." ...
3
votes
4answers
1k views

How to zip recursively all subdirectories that only contain text files

I have a backup from a disk that contains data files and analysis. The dir structure and names are not really consistent. To save space, I would like to zip all the subdirs that only contain data ...
3
votes
3answers
95 views

How do I search all subdirectories to find one with a certain name?

Let's say I have a top level directory called /dir and many sub directories. How do I search the subdirectories of /dir to find the one called x/x/dir/x/x/x/target? This question is similar to, but ...
51
votes
4answers
3k views

Pronunciation for /usr directory

How do you pronunce /usr? I found in the net that someone reads it "user"... but, for what I know, this directory is not related to the user. The meaning of the acronym is "Unix specific (or system) ...
1
vote
1answer
72 views

`ls` behavior on EACCES error for /root and /root/some-rubbish

I'm trying to code a clone of the ls command as part of a school exercise. I'm wondering why the following output is displayed by ls: $> ls -- -test_dir /root /root/some-rubbish ls: ...
5
votes
2answers
217 views

Show tail of files in a directory?

I have a directory that is too huge to browse by any means. Grepping returns argument lists too long, WINSCP crashes when trying to open the directory. Is there a way I can view just the last 200 ...
2
votes
1answer
105 views

Check for existence of files prior to acting on them

In one of my processes I check for existence of files older than 31 days, and then do stuff with them. find /my/directory/*txt -mtime +31 -exec ls -l {} \; All this is well and fine if files are ...
-1
votes
2answers
47 views

How can the number of files in a directory be determined by viewing “ls -ld” output? [duplicate]

The command has to be ls -ld Just from viewing the output of this, how can I determine how many files are in this directory?
4
votes
2answers
1k views

Why does a new directory have a hard link count of 2 before anything is added to it?

Say I just create directory newDirectory and then I do ls -ld command. I see that the number of hard links is 2. What exactly makes the hard link 2 from the start? Also is the number of subdirectories ...
0
votes
1answer
99 views

How can number of subdirectories and files be determined from ls -ld command? [closed]

How can number of subdirectories and files be determined from the output of using ls -ld command? I realize that this command only lists the directories.
0
votes
2answers
113 views

How can I for example list five largest files in /usr/lib -directory?

How can I for example list five largest files in /usr/lib directory? Please also add some minor explanation for each bit of code that you are using.