A file system structure in which to store computer files.

learn more… | top users | synonyms

3
votes
1answer
180 views

Expand ~, . and `..`

Since ~, . and .. are special directories, why are they handled differently in the following example? $ echo ~ /home/tim $ echo .. .. $ echo . . ~ is expanded into the dir, but the other two are ...
0
votes
3answers
42 views

How do pwd and . determine the current path differently?

Is it mainly because pwd is not a builtin, while . is builtin to the bash shell? For example, they differ in the following example: /tmp/ttt$ mv ../ttt ../tttt /tmp/ttt$ pwd /tmp/ttt /tmp/ttt$ cd . ...
0
votes
2answers
19 views

Select a range of files after sorting them

One thing I notice slower for me if I switch from using a GUI file manager to CLI is: In a GUI file manager, I can quickly select a subset of files under a dir by, first sorting them according to ...
22
votes
8answers
2k views

How to delete this undeletable directory?

I untarred a corrupt tar file, and managed to end up with some directory that I can not delete, If I try to delete it, it seems like it can not be found, but ls shows it's present, both with bash and ...
3
votes
2answers
66 views

Move every file that is not a directory

I have a directory that I am trying to clean out that contains both files and subdirectories. What I am trying to do is simple: move all the files into another directory, but leave all the ...
4
votes
2answers
30 views

Create new temporary directory

What's an effective way of creating a new /tmp directory, that behaves just like /tmp (purged on reboot, etc.), but in a different location? In my case, I want to create a ~/dev/tmp directory where I ...
2
votes
4answers
94 views

Change to the last modified subdirectory of the current directory

I have an application which generates a couple of files in different directories at a regular interval and I need to check the latest files generated, i.e. the file which is generated in the most ...
0
votes
0answers
15 views

What are differences between directory order and alphebetic order with `ls`? [duplicate]

What are differences between directory order (-U) and alphabetic order (by default) with ls? They return the same order of a dir's contents to me.
-6
votes
2answers
50 views

How to you create directories and set permission? [on hold]

How do you create three directories in /storage named campaigns, financials, and public. Also, I'm wondering how to set the file access permissions as follows: campaigns – marketing group has full ...
0
votes
1answer
36 views

“Links” to dirs that have features of both hard and soft links?

It is not allowed to create a hard link for a dir. But the soft like will not work, if I later change the name of the dir. How would you solve the dilemma? Are there applications which can ...
5
votes
4answers
217 views

Ways to organize and access frequently visited directories and files?

In my Ubuntu, I have added some frequented directories to the bookmarks of Nautilus, for visiting them quicker. Nautilus can consume a lot of memory, when it has been kept open for long and there ...
2
votes
3answers
45 views

copying parallel directories Why does cp -r work this way?

The following works correctly (ie does what I want) cd /var/www/release/ mkdir wiki cp -rp ../html/wiki ./ However if I do (what seems more intuitive) cp -r ../html/wiki ./wiki it will ...
3
votes
2answers
112 views

Valgrind /usr/lib files are not regular Linux files

The problem that I encountered today (on an embedded device with Linux) is that some files (specifically, the Valgrind /usr/lib files) are behaving very strange and they are not copy-able with scp ...
0
votes
0answers
9 views

In Ubuntu, what is the folder in which MySQL's UDF should be installed?

I am using Ubuntu 14.04. I wonder where should I install binary UDF for MySQL. Is there any way to discover the path of the UDF directory? Is there a standard for this in Ubuntu?
4
votes
5answers
305 views

Bash pattern to match all files but directories

In bash, how do I specify a pattern that matches everything but subdirectories in current directory. Given that the pattern */ matches all the subdirectories, I tried (with extglob turned on): $ echo ...
0
votes
3answers
34 views

cd to the most recently created directory [duplicate]

I have a directory in which a number of directories are created daily. I want to enter into the directory which is created recently whose name starts with cy. How can I find this directory? Could ...
1
vote
3answers
144 views

Removing a directory that has no files in it

I recently created a username and a group called gamesForAdmin. Since then I deleted it and the folder I made for it is still there: drwxr-xr-x 5 root root 4096 Jul 4 11:28 . drwxr-xr-x ...
0
votes
1answer
19 views

remove special character from files in directory

I need to remove special characters from all .htm files in a directory. Ideally I need to keep the file name but if I have to I can copy each file to 1 or something like that. Here is the command I ...
2
votes
1answer
44 views

Create directory using filenames and move the files to its repective folder

I have a folder with around 150 text files. I would like to create folders in the name of the 150 files. After that I would like the text file to be moved to its respective folder. Example names of ...
1
vote
2answers
46 views

Do Links to /tmp files get deleted?

I have a script that creates a temp directory using mktemp -d. A folder generated in the temp directory is the output of the script that will be copied to another part of the machine. I was ...
9
votes
4answers
331 views

Recursively iterate through files in a directory

Recursively iterating through files in a directory can easily be done by: find . -type f -exec bar {} \; However, the above does not work for more complex things, where a lot of conditional ...
1
vote
1answer
78 views

Trouble installing lxml with custom install location for libxml2/libxslt

I am attempting to install a python module called lxml to my account on a supercomputer running RHEL. I do NOT have root access or super user status. lxml requires the dev/devel versions of libxml2 ...
3
votes
2answers
102 views

Find files in directory with paired names

I'm running tests of a variable-size-and-contents test set. Data files are added and removed frequently. I'm looking for an automated way of gathering a file list. All files are in subdirectories of ...
1
vote
1answer
46 views

Only write permission for a directory doesn't allow to rename (move) files inside?

In fact, I would like to ask more general question -- "what does write permission for a directory allow you to do exactly?" -- but let's approach it with a concrete example. It is a long question, if ...
1
vote
2answers
49 views

tar compression without directory structure

Under my current directory, I have two sub-directories: dir_1/ - file1.png - file2.png ... - fileN.png dir_2/ - fileA.txt - ... - fileZ.txt When I tar compress the two ...
0
votes
1answer
23 views

Moved folder into other has now disappeared

Two folders in same directory and I wanted to move one into other with command mv foo /foo2 but now foo has vanished.
9
votes
3answers
339 views

How to spoof/mock a directory used by a binary application as another directory?

Suppose there's a binary application that always writes its data to /tmp. How could I spoof/mock /tmp for the sake of this binary as some other directory (e.g. home/tmp)? Let's assume I have no ...
3
votes
3answers
176 views

Return to directory location prior to cd-ing to home directory

As is well known, cd without an argument changes one's current directory to their home directory. I am wondering if there is any way, after using the cd command like this, to return to the directory ...
2
votes
2answers
90 views

inotifywait different action on file or dir

I'm trying to make a inotifywait script take different actions for files vs folders if it sees a close_write flag being raised in the watched directory, but cannot seem to get the checks working. In ...
4
votes
4answers
761 views

Can the /home folder in Linux contain anything else but user folders?

Can the /home folder contain anything else but user folders? I have a folder I want to share between Windows and Arch - can it go in the home folder under a name not belonging to any existing user? ...
2
votes
3answers
95 views

What is the difference between path and directory?

I don't understand the difference between path and directory. Could someone explain to me with examples?
2
votes
0answers
36 views

One way diff between 2 directories

I am looking to perform a diff between 2 directories, both of which contain may files and subdirectories. I am hoping to perform a one-way diff between a source and target directory that will return ...
1
vote
1answer
47 views

lost directory cannot find it with testdisk

I was moving a directory on my parents computer using a teamviewer session. The session responds slow and somehow, when I was moving the directory (location: /sdb/synchronisatie/nel/) something went ...
4
votes
2answers
64 views

setting default permissions with setfacl

I am trying to set default permissions on my directory structure using acl. I would like to have following default permissions for directories and for files respectively: drwx--x--- -rw-r----- but ...
1
vote
1answer
63 views

untar specific directory

tar tvf filename.tar gives me: -rwxrwxrwx 0/0 544795 2010-03-15 12:49 35 WOO WORDPRESS THEMES/bloggingstream.zip -rwxrwxrwx 0/0 1659095 2010-03-15 12:51 35 WOO WORDPRESS ...
4
votes
2answers
222 views

Determine what device a directory is located on

If I do # cd / # ln -s /home test # cd test # mount --bind $PWD /mnt the entry in /proc/mounts is /dev/sda2 /mnt ext4 rw,noatime,data=ordered 0 0 which is the device that is mounted to /home and ...
1
vote
1answer
62 views

On why touch, mv, etc., won't create subdirectories “as needed”

There are many Unix commands that will fail unless some subdirectory already exists, even though it would be a trivial matter for such commands to go ahead and create the missing subdirectory before ...
3
votes
2answers
169 views

Command for creating a directory and navigating into it directly? [duplicate]

Quite often I need to perform this two commands: mkdir abc cd abc I am curious whether there is a simple command (or an alias that I can create and use) to do it in one go, like user@GROUP:~$ mdcd ...
1
vote
2answers
38 views

`ls` fails for directory copied from Win and OSX [closed]

I'm not able to ls on a folder that I have just transferred from win7 to OSX via a FAT32 drive. I don't know how to search for an answer for this issue. I've attempted the following: sudo chmod ...
4
votes
3answers
411 views

Merging folders with mv?

If I move a folder with mv called "folder" to a directory that already contains "folder" will they merge or will it be replaced?
2
votes
1answer
189 views

Delete files/ folders with .nfs files

A lot of time when I delete a folder, it says cannot be deleted because of .nfs files Error - Device or resource busy How can I delete a folder ignoring these errors ( is there any flag in rm ...
0
votes
1answer
39 views

Dropbox on both Windows and Ubuntu 12.04.3 LTS

I have Dropbox installed on both Windows 7 and Ubuntu 12.04.3 LTS and there are two separate folders that are being synchronized so there is some waste of disk space. I would like to have only one ...
1
vote
1answer
214 views

cd to a name-unknown directory in a known path

I am trying to automate the deployment of a webapp under development that is frequently updated. The webapp comes in the form of a zip file with unknown name, and this directory structure: ...
39
votes
7answers
3k views

cd .. on root folder

Why cd .., typed at root folder, does not warn or fails with an error? I would expect: /$ cd .. -bash: cd: ..: No such file or directory Instead, I'm left at /. Of course, this is since .. does ...
-1
votes
2answers
174 views

FTP clients only showing 9998 folders in a directory with many more

How can I increase the limit of files or folder in linux? Right now when I use any ftp software it shows that there are only 9998 folder in that directory. But I ran a simple php script that would ...
3
votes
2answers
159 views

Path syntax rules

I'm writing a library for manipulation Unix path strings. That being the case, I need to understand a few obscure corners of the syntax that most people wouldn't worry about. For example, as best as ...
6
votes
2answers
215 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
59 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
785 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# ...