A file system structure in which to store computer files.
1
vote
1answer
113 views
Hide parent directory but allow to view dir
I would like the following result on my UNIX system:
ls -l /users/test -> permission denied, or any other way so I can't see the content of it.
ls -l /users/test/testdir/ -> shows all files in the ...
1
vote
1answer
114 views
Rename directory based on date of file in directory
I am looking for a smart way to bulk rename directories in my photo library based on the date the pictures were taken.
My specific use case: Export the image library from iPhoto or Aperture on OS X ...
1
vote
1answer
384 views
cannot 'ls' /mnt directory
I have a CentOS-6 machine that I'm working on that is running a live database. It's having a problem with the /mnt directory. I cannot ls the directory for some reason. stat is working and shows ...
3
votes
2answers
159 views
Why is bash giving me (apparently) conflicting information about a file?
Background
I am working on a RHEL 5 cluster. I want my Fortran program to read the file /home/bob/inputs/input_1
I asked Bob to give me permission to read all contents of inputs:
[bob@server]$ ...
3
votes
2answers
155 views
How to set an alias on a per-directory basis?
Suppose you have an alias go, but want it to do different things in different directories?
In one directory it should run cmd1, but in another directory it should run cmd2
By the way, I have an ...
1
vote
2answers
111 views
Get directory that script was called from
I have a script doSmth in /usr/bin. Is it possible to print the directory the script was called from is printed out by the script?
So If I call doSmth from /home/me the output will be /home/me.
8
votes
3answers
377 views
Flattening a nested directory
This is probably very simple, but I can't figure it out. I have a directory structure like this (dir2 is inside dir1):
/dir1
/dir2
|
--- file1
|
--- file2
What is ...
2
votes
2answers
199 views
Using wildcards to match a directory in bash
Lets say the folder structure is like so:
/home/
--user1/asdf
--user2/asdf1234
--user3/asdf325234
--cool/asdf
How could I change to asdf1234 without specifying the user? For example:
cd ...
4
votes
3answers
151 views
vim: How to switch to the directory listing from file view?
I have opened a dir vim some/dir. I can navigate within the tree, yet once I opened a file I wonder, how do I close the file view in order to go back to the directory listing to navigate to another ...
4
votes
2answers
195 views
How to go back n levels of directories from the command line?
For example, I do the following cds in succession-
cd /tmp
cd /home/admin
cd /root/
cd /some_other/directory
Now I am in /some_other/directory. Now, is there anyway to go back to /tmp, the ...
2
votes
1answer
138 views
How come I can append to files to a directory without write permissions?
I understand this first example:
> mkdir foo
> chmod u-w foo
> touch foo/test
touch: cannot touch `foo/test': Permission denied
> echo "BAD" >> foo/test
bash: foo/test: Permission ...
9
votes
3answers
801 views
When should I use a trailing slash on a directory? [duplicate]
Possible Duplicate:
How linux handles multiple path separators (/home////username///file)
Most commands I use in linux behave exactly the same whether I include the trailing slash / ...
3
votes
3answers
301 views
How can I automate the process of copying files from one folder to another in Centos
I have a statistical application which runs every minute and creates charts accordingly.
In order to make these charts available to other users, I need to copy the whole folder containing the charts ...
1
vote
3answers
96 views
Restructuring directories into a hierarchy
I have the following type of folder structure containing thousands of folders.
The folder names are as such with different names etc
.test
.test.subfolder
.test.subfolder.subsubfolder
.folder
...
0
votes
2answers
662 views
How to change the working directory of invoking shell using a script? [duplicate]
Possible Duplicate:
changing current working dir with a script
I am trying to create few scripts that would change the working directory of the main shell/terminal. Not able to do so. I ...
10
votes
1answer
192 views
How to log all the events performed on directory?
How can I log all the events performed on a particular directory?
I want to log the entry of each directory modified within some time duration. I am using find . -type d -mmin -5 command.
In ...
1
vote
5answers
905 views
ls: Do not show directories that match same pattern in wildcard searches, only files
Supposing I have something like the following, a typical business PC situation:
drwxr-xr-x 1 whatever whoever 3 Oct 3 16:40 invoices2009
drwxr-xr-x 1 whatever whoever 4 Oct 3 16:40 ...
6
votes
0answers
97 views
What's the size of a folder entry? [duplicate]
Possible Duplicate:
What does size of a directory mean in output of 'ls -l' command?
user@~ > ll /tmp/foo
drwxr-xr-x 2 user user 4,0K 1 oct. 15:15 bar
What are those 4,0K ? ...
2
votes
1answer
69 views
Are there widespread filesystems which represent directories with structures optimized for fast lookup?
In "The Art of Unix Programming", on the topic of The Terminfo Database I read:
If you look in the terminfo directory, you'll see subdirectories named
by single printable characters. Under each ...
0
votes
4answers
2k views
How to permanently change the file/directory permission [closed]
How do I change the permission of file/directories such that I am able to create, edit, delete files/directories anywhere in my system? Currently I am using Ubuntu 12.04.
I tried
sudo chmod 777 -r ...
2
votes
2answers
1k views
undo rm -r, restore data
I was playing around with zip and accidentally deleted my /home/ folder (i wanted to delete home/ which got created by unzipping an archive).
I used rm -r /home/instead of rm -r home/ as root...
Is ...
1
vote
2answers
212 views
Create and move to a directory in one command - unix [duplicate]
Possible Duplicate:
Is there a one-liner that allows me to create a directory and move into it at the same time?
I know this is a very basic question but I can't seem to figure out what to ...
4
votes
2answers
88 views
Quicker Way to Reference a Directory?
This one is probably easy for all of you, but I have never had to deal with such a nested local set of directories.
If I have a path like: /mnt/media2/Archived\ Files/_Transfer/ is there a way to ...
9
votes
5answers
1k 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 ...
1
vote
2answers
2k 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
129 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
384 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
5answers
215 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
but the output looks like:
.
./foo
./bar
but with ./ which I don't want. Is there a way to get find to output ...
3
votes
1answer
122 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
242 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 ...
15
votes
3answers
2k 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
245 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
150 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
426 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
195 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 ...
1
vote
1answer
862 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 ...
0
votes
2answers
1k 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
142 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
87 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
575 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
509 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
483 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 ...
2
votes
2answers
349 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
86 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
111 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
853 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 ...
2
votes
3answers
2k 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 ...
9
votes
2answers
220 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
107 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?
...
3
votes
3answers
1k 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 ...
