A file system structure in which to store computer files.

learn more… | top users | synonyms

9
votes
5answers
3k views

Creating numerous directories using mkdir

I would like to create many directories using mkdir. Each directory name will consist of a prefix (a string) and an index (an integer). Suppose that I would like the prefix to be "s" and the indices ...
2
votes
2answers
4k views

“cannot remove 'some_directory': Directory not empty”

I tried to delete some directory, but $ rm DE.aspx_files -r rm: cannot remove `DE.aspx_files': Directory not empty But listing its content returns none $ ls DE.aspx_files $ Added: Actually $ ...
2
votes
2answers
187 views

cp file device:directory on Minix

In my operating systems class we had to modify the boot screen of the Minix OS. I understood just about everything we did, but at the end of the make for compiling the new OS, there's a line: cp ...
3
votes
2answers
677 views

How do I get this find and rename command to work with subdirectories? [duplicate]

Possible Duplicate: Recursive rename files and directories I have a large directory of music files that is often changing as files and directories come and go. My preference is to make sure ...
3
votes
6answers
808 views

Get a list of directory names with find

I know I can do this to get a list of directory names: find . -type d -maxdepth 1 The output looks like this: . ./foo ./bar I prefer the listing without ./. Is there a way to get find to output ...
4
votes
1answer
223 views

What does altering a file/directory mean?

From man ntfsundelete Look for deleted files altered in the last two days ntfsundelete /dev/hda1 -t 2d I wonder what altering files/directories mean? Does deleting some files/directories ...
3
votes
1answer
585 views

Can't rename a directory that I own

I have a directory with a big load of sub directories. I own all of them, and the permissions are all 777. pascal@azazel /box $ ls -al total 147872 drwxr-xr-x 293 root root 12288 aoû 22 19:44 ...
21
votes
3answers
5k views

Why unix mv program doesn't need -R (recursive) option for directories but cp does need it?

This is a kind of "wtf?" question, so I'm sorry if I will disturb someone's vision of how things should be or if I will just annoy you with the "stupid" question. I always get messed up when need to ...
7
votes
3answers
1k views

How to remove only the content of directories?

I'm in a folder: /var/myfolder. Inside there are some other folders like: /var/myfolder/A/ /var/myfolder/B/ `/var/myfolder/C/ etc. Inside each there are some files with random names. How do I ...
3
votes
2answers
203 views

open a file using CDPATH and symlink

To quickly move around, I added a path to CDPATH that contains symlinks to different locations. I did this by adding the following line to .bashrc: export CDPATH=~/symlinks When working with ...
4
votes
2answers
757 views

Why can't I navigate into my Documents directory?

I'm in bash and running F17 as su. My pwd is /home/user and when I ls I see Desktop Documents Downloads Music Pictures Public Templates Videos However, I'm unable to cd into any of these. My ...
3
votes
1answer
269 views

How does the Linux file structure work?

I see the different folders bin, dev, mnt, proc, srv, sys, etc. What are the properties of all these different folders? What are there purposes? Are there files in some of them that I should not ...
2
votes
1answer
12k views

How do I remove a directory and all its subdirectories?

I'm trying to learn some directory navigagtion with bash and all I know is that rmdir directoryname will remove the directory but not if it's containing something. Is there a way to force it to ...
1
vote
2answers
3k views

bunzip2 to a different directory

Say I have a file foo.tbz2 in a directory. I want to extract the tar file from the archive, but to a different directory. It seems like bunzip2 will only extract the archive to the same directory as ...
4
votes
1answer
208 views

xterm doesn't switch directory when it is moved

Recently I was very frustrated with xterm not behaving as expected. This is what I was doing: open xterm run the following commands: $ mkdir test_01 $ cd test_01/ $ echo 'a' > a $ cat a The ...
1
vote
1answer
114 views

Linking “..” do somewhere other than parent directory and other strange fs beharviors

Can the entry ".." become linked to someplace other than the parent directory? Is it possible to cause "tar" to create this weird behavior? Scenario: I have a pre-built compiler to a embeded system, ...
1
vote
2answers
960 views

RewriteRule to cause subdomain to load another DocumentRoot?

I could sure use a little help with what I am trying to do with a RewriteRule in .htaccess: ...to causes URLs using our sharpedge. subdomain to auto-load from the Internet_IE directory - one level ...
2
votes
4answers
678 views

Make directory copies using find

I have a directory with a bunch of subdirectories in it. Thus /usr/local/src/ccl/ccl-1.8/x86-headers$ ls elf gl gmp gnome2 gtk2 jni libc Each of these directories has a further subdirectory C ...
3
votes
3answers
1k views

Rename multiple directories

I want to find all directories with the last subdirectory named doc, for then rename them to Doc. How can be renamed? I've the first part: find -type d -name 'doc' which returns directories paths ...
3
votes
2answers
686 views

How can I stop ls from descending into directories, similar to prune for find?

If I type ls *ro* I also get files in subdirectories that match the *ro* pattern. Is there any option for ls similar to prune? Ideally a flag, otherwise perhaps an exec?
4
votes
1answer
134 views

od emulation for directories

I was wondering why od(1) used to work in UNIX but doesn't work in GNU/Linux. There is a nice answer on serverfault. The next question is, are you aware of any tools that can emulate od behavior to ...
2
votes
2answers
128 views

What does it mean when the output of $ls -lasrt includes '.' and '..'

I input the command: $ ls -lasrt And the output includes (there are more results, these are the ones that confuse me): 4 drwxr-xr-x 5 tuc40953 stdchem 4096 Jul 3 17:48 .. 4 drwxr-xr-x ...
0
votes
2answers
1k views

How can I rename all files in the current directory having a particular extension to another extension? [duplicate]

Possible Duplicate: Renaming multiple files (changing extension) Suppose that in my current/working directory I have five files: file1.xvg file2.xvg file3.xvg file1.eps file2.eps Is ...
3
votes
3answers
9k views

How can I delete all files with a particular extension in a particular folder?

If I set the current/working directory (navigating to it using cd) to some particular directory and then type: rm *.xvg What will this command do? Is it true that the above command will only delete ...
10
votes
2answers
781 views

How can I copy a file and create the target directories at the same time?

I want to cp aaa/deep/sea/blob.psd to bbb/deep/sea/blob.psd How do I do the copy if the deep and sea directories don't exist under bbb so that the copy both creates the directories that are needed ...
1
vote
1answer
158 views

How to find/correct error in a path

It's often that a long path is mistyped or you get a log file entry that a path does not exist. Is there a command or shell function that navigates the path hierarchy until it finds a matching path? ...
4
votes
3answers
4k views

Find the total size of certain files within a directory branch

Assume there's an image storage directory, say, ./photos/john_doe, within which there are multiple subdirectories, where many certain files reside (say, *.jpg). How can I calculate a summary size of ...
3
votes
2answers
425 views

I want to tar X directory not including its parents

tar cvf /var/lib/backup/sample.tar /home/user/.project However, when I extract, I get its parents as well /backup/ - /home/ - /user/ - .project/ This tar commands does it job ...
19
votes
2answers
1k views

Where do the files go if you mount a drive to a folder that already contains files?

I just accidentally mounted a new drive to a folder that already contained files. I don't care about them and have them somewhere else, but that folder appears empty now. I'm curious what happened ...
7
votes
3answers
703 views

How can I cd to the previous/next sibling directory?

I often have a project directory layout like this project `-- component-a | `-- files... `-- component-b | `-- files... `-- component-c `-- files... I'll usually be working in one of the ...
5
votes
2answers
1k views

Stay at same working directory when changing to sudo

When working on the command line, I often change to sudo using sudo -i. However, my working directory changes automatically to /root. I never want to go there; I want to stay where I was! How can I ...
3
votes
3answers
705 views

Infinitely Nested Directories

Let me start off by saying this is a Mac Terminal I'm using. Not Linux, but I assumed I would get the best answers here as it has to do with Unix and the command line not really anything about Mac ...
0
votes
1answer
476 views

OSX : rmdir “permission denied” but directory removed

This is a question from a newbie trying to learn UNIX commands. I was trying to test the rmdir command by removing a test directory located in my Downloads directory. I have read and write rights on ...
4
votes
4answers
302 views

How can I use locate only for a directory

This finds a large number of files that are under various subdirectories of "Dropnot" $ locate Dropnot Can I find just the directory location with locate? (which directory "Dropnot" is in) So if ...
9
votes
4answers
33k views

“Input/output error” when accessing a directory

I want to list and remove the content of a directory on a removable hard drive. But I have experienced "Input/output error": $ rm pic -R rm: cannot remove `pic/60.jpg': Input/output error rm: cannot ...
1
vote
1answer
457 views

How does apache determine what directory to show from public_html?

I am using Ubuntu 12.04 and have configured apache to serve from ~/public_html. I am trying to serve some directory contents over http on LAN. When I did the following: ln -s ...
2
votes
2answers
261 views

execute bit on directories, but not files [duplicate]

Possible Duplicate: How to apply recursively chmod directories without affecting files? What is the command to apply execute permission for directories (for traversal), but leave the ...
2
votes
4answers
205 views

Say I have a file's path, how do I reference that file's directory from the command line?

I can type: dirname ~/home/blah/file.zip for instance, and this works fine alone, but when I use this syntax as the parameter for some command it always reads 'dirname' as the desired directory. ...
4
votes
1answer
15k views

How do I use sftp to get a directory and all its contents? [duplicate]

When I try to use the command get from sftp, I get the error saying that it is not a normal file. Is there a way around this?
19
votes
4answers
14k views

What is the 'working directory' when cron executes a job

I have a script that works when I run it from the command line, but when I schedule it with cron I get errors that it cannot find files or commands. My questions is twofold: When I schedule a cron ...
3
votes
1answer
584 views

creating abbreviations for commonly used paths

I am new to linux and was wondering whether it is possible to create abbreviations that can be used in terminal. I know about alias command, but am not sure whether that can be used for what I am ...
4
votes
3answers
306 views

Need to delete a directory with name '~' created accidentally

I don't remember exactly how this directory got created. It's name is ~, the alternative we all use for home diretory. I also see a sticky bit attached with this directory. How shall I delete it? I ...
2
votes
5answers
2k views

Unable to delete directory

On my OS X host, I am having trouble deleting the directory "foo". mymac:.Trashes joe$ ls foo mymac:.Trashes joe$ ls foo/ Ảnh011.jpg Ảnh012.jpg Ảnh013.jpg mymac:.Trashes joe$ ls -l foo/ ls: ...
10
votes
4answers
1k views

Best method to collect a random sample from a collection of files

Suppose there is a directory holding 300 data files. I want to randomly select 200 of those files and move them into another directory. Is there a way to do that under Unix/Linux?
4
votes
2answers
2k views

What causes ln: //: Is a directory?

When linking a directory to root, I get this error: $ ln -s ~/inbox/ / $ ln: //: Is a directory Bash autocompletes the directory path by adding a /. I've tried escaping without success. $ ln -s ...
7
votes
4answers
4k views

How can I force unzip / zip not to create a subdirectory when I extract it?

Depending on how a zip file is created, sometimes it will extract all of the files directly, and sometimes it will extract the files into a subdirectory. If the latter is true, how can I force the ...
1
vote
2answers
534 views

Bash prompt when my home directory is a symbolic link

I symlinked my /host/Users/Kevin folder to /home/Kevin. I also edit the /etc/passwd file to /home/Kevin. I logged out and logged back in, however when I open up a terminal it's a bash prompt like so: ...
5
votes
4answers
1k views

Recursively rename subdirectories that match a regex

I have a media server with a folder called Series. (/media/Expansion2/Series/) In it, I have (surprise!) TV series. These are just the show names, e.g., /media/Expansion2/Series/The Big Bang Theory/ ...
4
votes
2answers
1k views

How do I create a ZIP archive that preserves only the structure of the target directory and below?

I need to create a zip archive where the unzipped result preserves the directory structure from the specified directory down. I also need to do this without actually switching to the directory. My ...
35
votes
3answers
1k views

cd by just typing the directory's name?

I either had this somewhere 20 years ago or I dreamed about it. Basically: If if type blobblob I get blobblob: command not found Fair enough. I would like it so that when my shell gets those ...