A file system structure in which to store computer files.

learn more… | top users | synonyms

4
votes
1answer
117 views

Using '@' for a directory name

Though Unix/Linux will technically allow any character in file and directory names, using punctuation is almost always fraught with peril due to the extensive use the O/S makes of punctuation for ...
6
votes
4answers
3k views

How to recursively find the amount stored in directory?

I know you are able to see the byte size of a file when you do a long listing with ll or ls -l. But I want to know how much storage is in a directory including the files within that directory and the ...
2
votes
5answers
236 views

move a directory with a single character (back quote) as its name [duplicate]

How can I move a directory whose name is just a space? ls -lah drwx------ 4 user1 user1 8.0K Mar 13 14:16 . drwxr-xr-x 3 root root 60 Mar 13 13:48 .. drwx------ 18 user1 user1 4.0K Mar 13 11:18 ...
4
votes
4answers
334 views

Determining number of files in a directory without counting them

Related: What's the best way to count the number of files in a directory? I have a system with a largish number of files in a directory $ ls -god xml drwxrwsrwx 7 7070720 Mar 12 11:51 xml ...
1
vote
1answer
143 views

Create a recursive diff directory. Copy reference and diff. Recreate original directory

I have several directories/web site resources, each has total size of several gigabytes. They are more than 90% the same. Sometimes only a few files are modified. I need to download these files for ...
2
votes
2answers
52 views

PATH work with relative directories

I'm trying to get a program to work that isn't in my distro's package manager. It doesn't provide a makefile or sources, just binaries. If I copy the whole folder to /usr/local and then add that to ...
4
votes
1answer
388 views

Can I access Nautilus's bookmarks in terminal?

I have made a some bookmarks in Nautilus, i.e. shortcut links to some directories. I would like to cd to a directory which has been bookmarked in Nautilus. I was wondering if that is possible?
1
vote
1answer
42 views

Can one move a relpath in one command?

This question is similar to one I asked recently, but the answers to that question, for the most part, do not extend to this one, AFAICT. The main difference between the two questions is that the ...
5
votes
3answers
139 views

Filtering redundant paths from a list of paths

I have a list of relative paths such as this: dir1 dir2 dir2/dir3 dir2/file1 dir3/file2 dir3/dir4 dir3/dir4/file3 In the example above, the specifier dir2/file1 (for example) is redundant, because ...
2
votes
2answers
644 views

Can one copy a relpath in one command?

I find myself doing this often enough that I wonder if there's a standard Unix way to do it: % mkdir -p /TARGETDIR/relative/path/to % cp ./relative/path/to/somefile /TARGETDIR/relative/path/to In ...
0
votes
2answers
4k views

Remove soft link but not the target

I have a directory that contains a link to another directory that I just created. I would like to remove the link but preserve the directory my link was pointing to. How do I do this? > mkdir rgac ...
5
votes
8answers
2k views

Run a command on all subfolders

If you have a series of subfolders (like from a to z) and want to run a command on each one of them (like rm *.pdf or ls *.pdf), how do you do that? The "manual" approach would be cd a, rm *.pdf, or ...
2
votes
1answer
1k views

Makefile $wildcard only matches top directory

I am trying to implement a makefile for my C project which has a directory structure as follows: PROJECT_FOLDER: folder1 folder2 folder // n number of folders main.c FOLDER1: ...
21
votes
4answers
946 views

Is there any way attacker could use mkdir to compromise a system?

I'm setting up a restricted user account for user ricardo, a troublesome user on my system. I want to grant him the right to make directories using sudo, which he sometimes needs to do. I'm ...
1
vote
2answers
89 views

Why would running a directory path as a command return “permission denied” and not “command not found”? [duplicate]

I am an a redhat box and I noticed that if I accidentally type in a dir path without cd in front of it, I get a /path/to/dir/: Permission denied.; however, I would expect it to say /path/to/dir/: ...
3
votes
2answers
3k views

find flags: -exec rm -rf vs -delete

I thought the flags I mentioned in the question are the same, but I get the following message with the former, but nothing with the latter: $ find . -mindepth 1 -type d -exec rm -rf {} \; find: ...
-1
votes
2answers
74 views

Using .. and . to copy files from dirctories

I'm trying to copy a file from the home directory to the current directory( which is a subdirectory of a directory in home) using .. and . instead of path names or ~ This is what I tried, but it ...
1
vote
1answer
611 views

Total vs listed directories [duplicate]

On a server when I type in ls -al I get a list of the directories -bash-3.2$ ls -al total 12 drwxr-xr-x 3 root root 0 Feb 13 2011 . drwxr-xr-x 4 root root 4096 May 11 2011 .. drwxr-xr-x 55 ...
1
vote
2answers
1k views

Why can I only run a .sh file from the parent directory, not the child directory

I am a Linux noob. I noticed that this does not work: /tomcatDirectory/bin $ startup.sh //command not found but this does work /tomcatDirectory $ bin/startup.sh I am used to Windows. It seems ...
1
vote
2answers
177 views

have /home/user/Downloads (and other user folders) on a different partition

I recently got an SSD. I use it to store my / as well as my /home directories (on different partitions). For each user, I would like to have most of their folders on my big RAID-1 with 2 hard drives ...
4
votes
1answer
1k views

How can I mount a directory of the host system for use inside a FreeBSD jail?

I am performing the following on FreeBSD 9.0-STABLE: mount_nullfs /foo /jail/foo After that, from within the host system, the mount works. So this works: touch /foo/bar && ls /jail/foo/bar ...
3
votes
1answer
151 views

Passing all files of specific filetype in current and subdirectories

I have constructed an elaborate 500+ character command with many arguments and switches to autosign multiple PDF documents. I'm using JSignPDF and I'd like to use it's batch mode including the ...
8
votes
3answers
431 views

What are ./ and ../ directories?

Simple question, but I'm not sure where to look and google doesn't respond to periods and slashes. I'm just trying to count the # of files & directories in the current directory (not including ...
4
votes
4answers
590 views

mkdir -p for files

mkdir -p will create a directory; it will also make parent directories as needed. Does a similar command exist for files, that will create a file and parent directories as needed?
37
votes
6answers
5k views

The result of ls * , ls ** and ls ***

I know using the command ls will list all the directories. But what does the ls * command do ? I used it and it just lists the directories. Is the star in front of ls means how deep it can list the ...
0
votes
1answer
1k views

How to display directory permission without listing permission for their contents [duplicate]

Possible Duplicate: How can I make ls show information about the directory specified only, not info about its sub-files or folder contents? I am new to UNIX and I want to display the ...
5
votes
2answers
379 views

Can a user brute-force a directory listing without having read permission on the directory?

I noticed that when a user is working in a directory to which he does not have read permission that using cd produces different error messages, depending on whether or not a subdirectory exists: $ ls ...
4
votes
1answer
6k views

How to make a Desktop “shortcut” that opens the terminal but under a different directory than the default home?

Objective I am looking for an easy way to consistently run a terminal that automatically opens to a specific directory. Is there a way to do that without changing the default directory? Preferably I ...
1
vote
2answers
749 views

How can be monitored I/O stream in a particular Linux directory or file?

I have a problem with monitoring of i/o stream in the particular directory(amount of read and written bytes during specified period). I have been trying to use iostat, inotifywait and inotifywatch, ...
7
votes
1answer
395 views

What is the significance of the dot in bash commands and how is it different from an asterisk?

I'm trying to understand the significance of the dot in bash and how it differs from an asterisk. Can someone please elaborate? For example, what's the difference between cp -ar /foo/. /foo2/ and cp ...
3
votes
1answer
103 views

File- and directory-based workflow

I work at a company where third party contributors transfer files, typically by FTP, to our site. Depending on which account the file is uploaded to, some scripts are triggered and the file is ...
24
votes
1answer
3k views

Why was '.' chosen to represent the current directory and '..' for parent directory?

After reading this question Design question: Why was '~' chosen to represent the home directory?, next obvious question on my mind was why '.' and '..' was used to represent current directory ...
9
votes
7answers
5k views

How do I create a directory in all subdirectories?

Suppose I have a directory structure like this: $ [~/practice] ls a/ b/ c/ d/ Now I want to create a directory tmp1 in all sub directories of practice and I do this: $ [~/practice] mkdir */tmp1 ...
1
vote
1answer
117 views

What is the “~/” directory?

I'm trying to locate where some files are stored and I can easily browse to them via ssh by going to "cd ~/foldername", however, I have no idea what directory "~/" actually is. When I browse around ...
5
votes
3answers
1k views

What are the advantages of the Unix file system structure

If I install an application in Linux for example Debian/Gnu Linux, the files of the applications are copied to many different directories in the file system. Some scripts goes into /usr/share .. ...
6
votes
3answers
883 views

Read a directory to see the file to inode mapping

I'm just learning about filesystems and it is said that a directory is just an ordinary file which keeps a list of file-inode pairs. If I try to open the directory Downloads with any of the following ...
3
votes
2answers
891 views

rm -fr not working

I have a directory that was generated by mistake by an application and this directory has a structure that involves more than 2000 directories, one inside a another, something like: Directory aaaa ...
0
votes
2answers
60 views

Knowing if a directory is modified

I have a server online and I am wondering if there's a way to know if some file on the server is modified or a new file is added to certain directories. For example, I have this ...
3
votes
1answer
599 views

How can I set a directory maximum size?

Is there an easy way to cap the size of a directory? I don't think there is but just wanted to make sure. I would like to set max directory sizes for some user home dirs as well as some other dirs, ...
9
votes
3answers
1k views

what is wild card to select all directories in a directory

i want to set sticky bit for all directories in a directory excluding files. is there any wild card to do this? #sudo chmod g+s /var/www/<WILD_CARD_FOR_ALL_DIRECTORIES>
1
vote
1answer
571 views

Help renaming folder according to date

I have the folder "Backup yzT Jan-01-2013". I've made also a script for do a backup everyday. The problem I'm facing is how to rename the folder day by day according to date? Get the new name is ...
2
votes
2answers
430 views

Reorder folders on FAT32 drive

My car can read MP3 files from a FAT32 flash drive. I have a folder for each artist on the drive, then MP3 files in those folders. However the car does not read the folders alphabetically, but by the ...
5
votes
5answers
2k views

Delete all folders containing files which match pattern

I'm trying to delete all subdirectories of my current working directory which contain a rar file. My first attempt: find -name *.rar -exec rm -r {}/.. ';' failed because that is not a valid ...
1
vote
1answer
3k views

Wallpapers' s folder in XFCE4

I've just installed XFCE4 on Arch Linux, now I'd like to add an image in the wallpaper folder, someone know the full path. I'm searching, but I haven't found yet.
4
votes
2answers
554 views

Can we use symbolic link and hard link for directories?

I know we can do that for files. What about directories? It seems that cpanel uses that a lot.
4
votes
3answers
697 views

How do I point certain directory to /dev/null?

I am running CentOS with cPanel, which creates a custom log directory and writes the logs there. The result is that the IO for the hard disk goes sky high. If I do lsof I got: hostsite.com httpd ...
4
votes
2answers
424 views

Dots in path name

I am receiving an error from an application I am running. The error looks like this: john@john-replacement:~/Desktop/yarbu-1.4.8/bin$ sudo yarbu-engine --VERBOSE /usr/local/bin/yarbu-engine: line ...
5
votes
3answers
293 views

What's the best way to list size of / in Terminal?

I want to see how much total space / is taking, but I don't know how to do that. I can use ls -hal and add up the subtotals, or I can use fdisk to tell me the size of that partition, but is there a ...
4
votes
2answers
365 views

How to lock a directory?

I want to block any kind of access to a certain directory unless a password is provided. It could be my root or account password. The directory is residing on an NTFS partition, and this method needs ...
1
vote
2answers
213 views

Dir diff and removal

Is there a simple way to (recursively) remove all files from a directory A that are identical (same name and same hash) to files in directory B while preserving the structure? e.g. A/file1 gets ...