A file system structure in which to store computer files.

learn more… | top users | synonyms

5
votes
3answers
1k views

How do I remove all sub-directories from within a directory?

This question is kind of a phase II to the first question I posted at here I have a directory that contains a bunch of sub-directories, .zip files, and other random files not contained within a ...
2
votes
3answers
612 views

Find directories that do not contain subdirectories

I'm writing script is ksh. Need to find all directory names directly under the current directory which contain only files, not subdirectories. I know that I could use ls -alR and recursively parse ...
0
votes
1answer
218 views

how are directories implemented in UNIX filesystem?

This question is extension to How are directories implemented in Unix filesystems? I'm aiming to implement basic filesystem: After reading inode number and name we come to know Name of file and hence ...
0
votes
1answer
70 views

Rsync adding a “?” at the beginning of directories

I currently have many of these commands running in a .sh file that looks like this: rsync -avz -e ssh --rsh='ssh -p1337' --bwlimit=10000 root@DestinationIP:/home/backup /home/localbackup rsync -avz ...
3
votes
2answers
291 views

Why do . and .. have a file size of 4 kB and 12 kB, respectively? [duplicate]

As displayed by ls -al, for example: drwxr-xr-x 9 jb jb 4.0K Mar 8 18:05 ./ drwx------ 49 jb jb 12K Mar 17 14:15 ../ I assume this is the minimum amount of space required to store the inode's ...
3
votes
1answer
605 views

“Recently used” directories and files in bash

In Firefox under Ubuntu, when I try to save some webpages to my local computer by Ctrl+S, there will be a window popping out for me to select the destination, where I can choose "Recently Used" ...
4
votes
1answer
91 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 ...
4
votes
4answers
684 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
201 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
234 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
113 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
40 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
193 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
38 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
121 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 ...
1
vote
2answers
335 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
415 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 ...
4
votes
8answers
922 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
693 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: ...
20
votes
4answers
814 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
73 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
1k 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
64 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
407 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
798 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
159 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
748 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
107 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
337 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 ...
3
votes
4answers
367 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?
32
votes
6answers
3k 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
511 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
283 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
4k 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
544 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
269 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
94 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 ...
23
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 ...
7
votes
7answers
3k 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
113 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 ...
4
votes
2answers
594 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
519 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
483 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
59 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
252 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, ...
8
votes
3answers
895 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
323 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
305 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
1k 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
1k 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.