A file system structure in which to store computer files.

learn more… | top users | synonyms

1
vote
1answer
62 views

How to copy files from one directory to another so that only new files are copied? [duplicate]

How would it be possible to copy all new contents from one directory to another so that only new files are copied from the source directory (both directories have the same naming tree). For example, ...
3
votes
3answers
53 views

How do I create and automatically sync a “merged” directory from multiple other directories without duplicating files?

If I have some number of source directories, e.g. dir1, dir2... dir5, how can I create an automatically syncing "merged" destination directory that has all the files and directories of the source ...
1
vote
0answers
21 views

Denying access to multiple directories in vsftpd.conf

I am trying to use the deny_file directive to prevent users from accessing several directories inside a local root, using vsftpd. For example, I would like to forbid users from entering inside the ...
0
votes
0answers
18 views

Is this correct folder name `//` achieved via `cd //` [duplicate]

I never saw this before, nor I can track this via Google, and I thought interesting to share. If I set cd // and I pwd I get the output //. If I touch a.txt I checked this file belongs to / If I set ...
2
votes
1answer
52 views

What is the effect of “chattr +a” on a directory

The a Linux file attribute is often documented as applicable to files. chattr(1) manpage: A file with the 'a' attribute set can only be open in append mode for writing. ext4 wiki: 0x20 ...
1
vote
1answer
26 views

Moving non-writeable files vs moving non-writeable directories

I'm a bit puzzled about the following behavior (Linux, Debian 8.3, ext2 filesystem) test@linux:~$ ls -ld directory/ file drwxr-xr-x 2 root root 4096 Mar 10 18:51 directory/ -rw-r--r-- 1 root root ...
22
votes
8answers
1k views

Clipboard for copying and pasting files in command line?

In Bash, suppose I visit a directory, and then another directory. I would like to copy a file from the first directory to the second directory, but without specifying the long pathnames of them. Is it ...
1
vote
1answer
89 views

How to redirect file output to a different directory?

I have a program that regularly outputs files to a directory, let's say /a/b. I am utterly unable to change where these files are outputted. But for me to use them, I must first move them to, let's ...
-4
votes
1answer
43 views

how to move all files under one directory to home directory

I have the script files script1.ksh ...script10.ksh in the directory star2 PATH : home/aaa/star2 I need to move all the files under star2 to the home directory (home/aaa) NOTE : I do not want the ...
1
vote
1answer
47 views

What does @ in front of a directory name imply?

On my Synology NAS, when I do ls on my volume, I see that a few directories a leading @ in their names. A few also have a trailing @. What does this imply? Examples: @optware @autoupdate
2
votes
4answers
66 views

How can I tell my program to save in ~

I'm using a program which processes some data and then saves it to a file. It is possible to specify the directory in which the data is saved, however the program is badly written, so if I put ~ it is ...
0
votes
2answers
121 views

rmdir dir gives error 'Not a directory'

I have what looks to be a directory directory dir2, I once moved it from another directory dir1 to back it up and created a new dir1. Now I suddenly saw it again, realized I didn't need it and did rm ...
10
votes
2answers
157 views

Are there any filesystems for which `ln -d` succeeds?

From the manpage for ln: -d, -F, --directory allow the superuser to attempt to hard link directories (note: will probably fail due to system restrictions, even for the superuser) Are there any ...
0
votes
4answers
72 views

How to merge one directory into other?

May somebody tell me if there is there some way to "merge" one dir into another? I.e. let I have /some/directories/structure with subdirs/files. And now I want to "implantate" it into /etc for ...
1
vote
1answer
29 views

How do permissions on a directory affect files in it?

I just learned something that shocked me, because I did not have a clue it was a fact. If I have a directory with the following permissions: user@host:~$ ls -la testdir total 8 drwxrwxrwx 2 user ...
2
votes
2answers
76 views

Grep only in files that are in certain folders

I want to grep for interesting string, but only in specific folder/file combinations, such as myfolder/myfile.out. The directory I'm grepping from may have these combinations in subdirectories of ...
2
votes
4answers
133 views

Go through every subfolder, check for a folder and run script

I have a directory that contains subfolders of various depth. I want to go through all of them, check if they contain a folder with a certain name, and if that directory exists run a script (let's ...
1
vote
1answer
34 views

SUID has no effect on directories with Linux

Why does the SUID bit have no effect when applied to directories in Linux? I clearly see that I can set it with 'chmod u+s'. But why does it not have "any" effect. What is the reason for implementing ...
1
vote
2answers
34 views

Symbolic link ./././

So I was asked to create a link "..." like ../ but two go an extra level up in Linux. I understand that I must use ln -s to create a symbolic link, but I'm unsure where to go next. I am new to Linux ...
14
votes
7answers
616 views

Compact bash prompt when using a directory tree / filename

In a system with Ubuntu 14.04 and bash, I have the PS1 variable ending with the following contents: \u@\h:\w\$ so that the prompt appears as user@machinename:/home/mydirectory$ Sometimes, ...
1
vote
1answer
53 views

Access directory by modification date

Is there a way to refer to a directory by its modification date, like cd ~/$newest/subdirectory? I know that I could (and shouldn't?) parse ls, and I currently just use a hacky script that generates ...
4
votes
1answer
51 views

Is there a tool to create a hard link to an unlinked inode?

Assume you have a filename/directory name, whatever, which is hard linked to inode 6400. Alas, the file/directory actually exists (completely intact, and maybe it only lives in a single data block, ...
1
vote
2answers
265 views

How do get ls to list directories with a trailing forward-slash?

My shell is bash. How can I get the output of ls to show directories with a trailing forward-slash? When I do ls in tcsh it gives the desired output. How can I get this to occur in bash without ...
2
votes
1answer
71 views

Cd into the no name directory

I am in my flash directory # cd /media/Flash/ # ls -al drwxrwxr-x 10 root root 4096 Feb 22 14:35 . drwxrwxr-x 7 root root 4096 Feb 20 15:57 .. -rw-rw-r-- 1 root root 2024 Feb 17 09:17 file1 -rw-rw-...
4
votes
2answers
49 views

octal dump of directory

I got a copy of The Unix Programming Environment by Kernighan and Pike from a garage sale. I'm very interested in the chapter about the UNIX filesystem. Naturally, I also found this passage very ...
1
vote
1answer
28 views

DirectoryIndex not redirecting

I am fairly new to apache and was a SQL Server database admin in a former life so please forgive my ignorance. I am trying to set up an Apache web server (HP-UX flavor) to conform with the DOD STIGs ...
-2
votes
1answer
33 views

How to get files from broken directory? [closed]

I created some files and directories on external NTFS HDD using Ubuntu. Some folders displayed with cross sign, I changes permissions for them (777), now they just as a files. Copying of directory ...
1
vote
1answer
142 views

Directory permissions “r-s”, chmod 655 does not change to “r-x”, why?

I created a directory in my home directory. and I set its permission as follows: uhmwk.1.4$ chmod 655 dog uhmwk.1.4$ ls -l total 4 drw-r-sr-x 2 s9 s9 4096 Feb 14 21:57 dog why is the group ...
1
vote
1answer
35 views

Bourne Shell do while loop returns all the data but has two errors no such file or directory and repeats the shell name

The idea of my loop is to print the first digit of every line of a file. The file being this: 256-56-8411 Bob 3.61 Junior CS 471-44-7458 Tim 3.45 Senior CE 326-...
1
vote
1answer
74 views

Get the real, apparent size of a folder

I am using the du command in order to get the size of the folder. As I am interested in the actual size I ended up with the following command: du –sh --apparent-size <someFolder>/ In this ...
3
votes
2answers
48 views

When can I omit the dot character that indicate the current directory

Should I use dot to indicate the current directory for accessing directories or should I use it for files only? For example, if the current directory is foo and it contains bar directory and baz.txt ...
4
votes
3answers
159 views

How can I rename a directory with name made of non-printable characters only

On SunOS I have directories with names containing only non-printable characters. The command ls -ldb * returns the following (some spaces deleted) drwxr-xr-x 3 user1 group1 3 Feb 4 18:10 \0122011\...
0
votes
2answers
38 views

Where does the find command look first if there are directories with the same name?

Suppose I have two different directories with the same folder names: /usr/myDir/ and /home/myDir/ If I run a command such as: cd $(find / -type d -name myDir) it navigates to /usr/myDir. Why is ...
13
votes
5answers
367 views

How can I find the first missing directory in a long path?

Imagine I have a path that doesn't exist: $ ls /foo/bar/baz/hello/world ls: cannot access /foo/bar/baz/hello/world: No such file or directory But let's say /foo/bar does exist. Is there a quick way ...
0
votes
1answer
31 views

Using if and find together

I'm trying to write a script that echos "success" if it finds .trc files older than 5 days in a directory. However I'm getting a full_path_trace': No such file or directory error even though my ...
1
vote
2answers
72 views

Difference between /usr/bin and /usr/local/bin [duplicate]

What is the difference between /usr/bin and /usr/local/bin? Why are there both directories and why do some executable programs exist in both directories?
3
votes
2answers
62 views

Getting the full path name of a given directory

Suppose I'm in /path/to/dir. Within this dir is another dir called subdir. Is there a command I can issue which outputs the full path to subdir, no matter how it is identified? For example: $ cmd ...
1
vote
0answers
39 views

Bash tab completion not working within symlinked directory

I'm working with Bash 4.2.46 on RHEL7 with the bash-completion packages installed, but I seem to have found an odd corner case where tab completion doesn't seem to work as expected. I have a set of ...
0
votes
1answer
72 views

bash: /home/hadoopuser/hadoop/sbin: Is a directory

I am in Ubuntu 14.04 LTS. Based on how to set a Hadoop cluster I am executing this: # Add Hadoop bin and sbin directory to PATH export PATH=$PATH:$HADOOP_HOME/bin;$HADOOP_HOME/sbin where I know ...
2
votes
4answers
74 views

cd into last alphanumeric directory

I have this directory contents: As you can see, the directory names are just timestamps - in general when I am the top level directory I usually want to open the most recent directory which is the ...
2
votes
2answers
78 views

difference between /dir and /dir/ [duplicate]

Consider a symlink I am making to my Music directory named music. ln -s Music music now consider following sequence of commands: edward@ArchLinux:~$ readlink music Music edward@ArchLinux:~$ ...
1
vote
1answer
41 views

Ways to consolidate music folder

Having used iTunes for a long time, my iPod Classic finally started showing signs of dying. I bought a FiiO X5II and put all my music onto it's microSD XC card(s) using rsync to ensure the same folder ...
0
votes
1answer
31 views

How do I remove a . from the start of a Bash string and write the result to a variable? [duplicate]

I am presently writing a shell function and it would help me in writing it to be able to remove a . from the start of a folder name (changing the folder name from that of a hidden folder to that of a ...
3
votes
0answers
51 views

Reason for security software to not scan directories with more than 10,000 resources in them?

We have a security software on Linux which scans for exploits in files that exist in directories on the server (such as if websites had hack scripts uploaded to them). It defaults to a limit of 10,...
0
votes
1answer
17 views

Manipulate du's output to get a custom printout [duplicate]

I typically run the command below to check size on each directory. du -sBM /* | sort -nr | head -n20 However, specifying a block size of "M" here will give everything a value in "M". The problem ...
4
votes
2answers
366 views

Is there an inode for a directory?

Each file has an inode. Is there an inode for every directory ? If not, how does Linux manage directories.
1
vote
1answer
83 views

udev creates the right rules, but rights disappear as soon as I try to access files via C++

I'm facing a really strange problem using udev. As I already explained here I'm trying to access some folders/files as a no root user Here are my udev rules for the gpio folder: KERNEL=="gpio*", ...
-2
votes
2answers
65 views

Is this good in order to have an empty directory?

I would like to have a directory mydir with empty content, but I don't know in advance if it already exists, or when it does, if it is empty. So my way is mkdir -p mydir ...
0
votes
4answers
183 views

Flattening complex folder structures with duplicate file names

I have a folder with a complicated folder structure: ├── folder1 │ ├── 0001.jpg │ └── 0002.jpg ├── folder2 │ ├── 0001.jpg │ └── 0002.jpg ├── folder3 │ └── folder4 │ ├── 0001.jpg │ ...
0
votes
0answers
52 views

Flattening folder structure with duplicate file names [closed]

I have a folder with a complicated folder structure: ├── folder1 │ ├── 0001.jpg │ └── 0002.jpg ├── folder2 │ ├── 0001.jpg │ └── 0002.jpg ├── folder3 │ └── folder4 │ ├── 0001.jpg │ ...