Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [directory]

A file system structure in which to store computer files.

0
votes
1answer
53 views

Restore function in unix

I have a script to recover files back to their original location. I am missing the options for the script to as "Do you want to recover this file?" Yes or No. How will I implement it into this code ...
0
votes
1answer
38 views

How to find duplicate directory paths even if the contents are different?

I've searched high and low but it seems all but one (Find and list duplicate directories) topic I've found actually deals with my situation, and the result isn't quite what I need. Edit: Here's some ...
-1
votes
1answer
63 views

Bash script: Sorting video files by duration [on hold]

I have multiple video files with different duration in one folder and I would like to sort these files per 1 hour. What I need to do: get the duration of video files, then move files into ...
1
vote
1answer
34 views

Shell script to test ls output for directories

I am trying to make a BASH script to test the files in the working directory and return the files that are directory files. One approach that I can think of is, starting with ls and feeding the ...
0
votes
2answers
52 views

Copy every 10 files from source into a target directory using cp

I have 110 large files inside a directory. But I cannot copy them at once since the system gets timed out after 50 min. I want to copy files 1 to 10, next 11 to 20, next 21 to 30, and so on. The order ...
1
vote
0answers
31 views

I have a directory of 110 large files. I want to copy them in the batch of n (e.g., 10) to aws s3 [closed]

I have 110 large files inside a directory. But I cannot copy them at once since the system gets timed out after 50 min. I want to copy files 1 to 10, next 11 to 20, next 21 to 30, and so on. The order ...
1
vote
0answers
20 views

Folders and files permissions for SDKMAN tool on Ubuntu

I am Java developer trying to set up my local CI server using Linux Mint. One of the crucial tools I would like to use is SDKMAN - the tool that allowes easy installation and management of different ...
1
vote
1answer
37 views

Makefile - How to install a bash script into user's bin directory?

I need to make a Makefile to install a bash script into a user's bin directory, but I'm not sure what the best way of doing this would be. Should I be using a variable that accepts user input to ...
1
vote
0answers
29 views

How to restrict autocomplete for the files found from PATH?

What I would like to be able to do is to have a list of words that are allowed to be autocompleted when typing the first word in the command line. Say, I have PATH=/dir, and the directory /dir has ...
0
votes
2answers
15 views

.tar archive files EACH to its own directory?

I have an archive that contains files from various directories (created with -T option, so I used file with list of files to archive). Files preserve owners and rights. Content is like: var/lib/...
0
votes
0answers
30 views

Add trailing slash in csh

How do I get csh to add a trailing slash at the end of tab autocompletion? eg: \stuff \otherstuff now if I type cd s and press tab, I get: \stuff and not \stuff\
0
votes
3answers
33 views

How to list all directory paths including a text?

I need to list all directory paths including a text which is part of thier sub-directories. For example, the text is "tpcc" and I have two paths including tpcc as following: /home/arghy/sampledir1/**...
0
votes
0answers
23 views

A way to see your location history within the command line?

Similar to git's reflog, I'm looking for a way to see the directories I have moved through. I have lost something and I'm not sure exactly what happened, and something like the reflog is exactly what ...
0
votes
2answers
24 views

List lastest modified or newly created files in linux

How to list modified or newly created files or directories in linux. So that I can trigger another command or shell script for another task. for eg. A file a.txt and test.txt are modified and I ...
0
votes
0answers
34 views

How to map / mount a directory to another

I have two directories: /volume1/photos/ /volume1/shared_photos/ In shared_photos I have several sub-directories with pictures. What I want to do now is to "mount" or all the files from ../...
0
votes
0answers
27 views

What's causing folder to change ownership?

I have something funky going on with a few folders I'm hosting on a parallel filesystem. Every so often, the group ownership on the folders will revert to root:root Instead of an appropriate service ...
1
vote
1answer
46 views

Git init in wrong directory? How to recover? (theoretical situation)

This is completely theoretical, but I'm new to Git and Linux so I want to know. If I accidentally manage to do git init inside e.g Desktop or Home directory, how to prevent any possible disaster from ...
2
votes
3answers
104 views

How can I make rm -rf ask for confirmation just once at the directory level?

If I use rm -rfi, this asks me every time each file is deleted. If I have a list of rm -rf commands, how can I make it so that the machine asks me for confirmation just once (when trying to delete the ...
1
vote
1answer
66 views

Creating directory tree based on file name

I have a large number of files with the following structure: [Lion] 2015 Africa Book.pdf [Lion] 2015 Africa Magazine.pdf [Lion] 2016 Africa Book.pdf [Lion] 2016 Africa Magazine.pdf [Lion] 2015 Asia ...
0
votes
2answers
58 views

Is it possible to “add” a second folder to the current folder file contents? symlink?

question: Is it possible to "add" the contents of a 2nd folder to the current folder file contents? (In essence I was asking from a full Unix is perspective but may be nginx would work too as the goal ...
-1
votes
1answer
35 views

file -b command return on sticky bit files

I am trying to understand why the file -b command is returning a certain value(s) when the sticky bit is set. When I run file -b <dir> where dir has its group set to g+wrs, file -b returns ...
1
vote
1answer
36 views

How to reference a child directory, that is part of cwd's path?

Is there a generic way to reference a path that is nested an arbitrary level deep along the cwd? This is almost like a reverse relative path lookup. For example: $ pwd /Users/somebody/foo/bar/baz $...
0
votes
1answer
19 views

How can I predefine a path for a user logged in via SSH?

I'm looking for a way to set something like a default path for a user on my server. So for example I've the user XYZ. When I login now with this user on my server, I want to be directly in a defined ...
2
votes
1answer
102 views

“Cannot create directory … no such file or directory”

When executing the dockerfile, the command RUN cp -rf roundcubemail-1.2.3/. /var/www/html/ is executed and I'm getting the following error: cp: cannot create directory '/var/www/html/': No such file ...
0
votes
0answers
72 views

VSFTPD refuses to list directory when PASV is enabled

I'm configuring VSFTPD on Ubuntu 18.04 and have followed all the guidelines. It's working OK for plain FTP (insecure), however as soon as I enable SSL/TLS and Passive mode, it connects, but I am ...
0
votes
0answers
17 views

Copy specific named directories, where content changed the last 24 hours

I can recursively find and copy all my test-directories (with content) of the current directory: find . -name test ! -path "./my_dest/*" -exec cp -r --parents {} /path/to/my_dest \; But now I want ...
0
votes
1answer
83 views

Nemo file manager is completely ignoring `_` at the beginning of directory name, when sorting

Ex. suppose some directories are named absorbing appreciate arrive connect depend drop few fold littlel popcorn shrill sticky In Windows, if I put _ before the directories, it would be at the top, ...
4
votes
2answers
247 views

Find the age of the oldest file in one line or return zero

I want to find the age of the oldest file in a certain directory or return 0 if there aren't any files in this directory. I also need a one-line command doing it. So far this is my command for finding ...
0
votes
1answer
72 views

mv multiple directories into the same directories

I want to move multiple directories to the directories if the second directory exist. Initial: dmv/toto/toto0 dmv/toto1/toto1 dmv/toto2/toto2 dmv/toto0/toto00 dmv/toto2/toto02 Final: dmv/toto/...
2
votes
3answers
59 views

Determine the number of directories inside a tar file without extracting it

I need to count directories inside an archive file (e.g. tar.bz) without extracting the archive. Note that the archive is too big so that it will be hard to extract then count directories using ls | ...
0
votes
1answer
90 views

Linux directories read/write behaviour?

I need to know how the directories of a Linux system are used, in relation to their approximate read/write behaviour in time. So far I have not been able to find any references. Can anybody provide ...
3
votes
1answer
99 views

Permission denied when cd to symlink'd dir in /tmp that is 700 and owned by regular user

Question: Why am I not able to cd into a symlinked directory with 700 permissions, owned by a regular user, as root, when I am able to change into the directory itself? Example: ttucker@plato:/tmp# ...
3
votes
2answers
42 views

find command outputs files without a directory structure

I want to tar some Python files and send it across a server. I do: find /some/path -iname "*.py" -exec tar czfv python_files.tar {} + Followed by: pv python_files.tar| ssh some_user@some_server '...
0
votes
1answer
70 views

Recursively exclude directory with pattern using tar

I have a directory with various python packages that I'd like to archive using tar. I need to exclude the numerous __pycache__ folders that get left behind by the build/testing process but using --...
2
votes
2answers
50 views

How to masquerade a file path as another in Linux

I want to have the file path /var/test appear as /root for the user test123. I don't want them to actually be in the root directory but I want it to appear as being in /root so that they can't tell ...
0
votes
1answer
43 views

Getting find: bad option -o -name abc -o -name xyz when perform search for *.properties excluding set of directories from search [closed]

#!/usr/bin/ksh # ***************************************************************************************** # copy_properties.sh # This script copies *.properties files from all directory excluding ...
-1
votes
3answers
44 views

Mv several file to directory with same basename

I have several files with different extensions and directories with the same basename, like this example. FileA.txt FileA.html FileA.directory/ FileB.txt FileB.html FileB.directory/ FileC.txt FileC....
0
votes
0answers
37 views

cannot permanently delete Xcode.app in trash, not even if with “sudo rm -rf” because directory is not empty?

I run on osx 10.14, and I was trying to delete and reinstall xcode. I have also tried the following in safe mode but have the exact same problems. I moved xcode.app to trash, right clicked and chose ...
1
vote
0answers
58 views

Sort directories before files and underscore first with ls

When using 'ls' i want to sort directories first and then all files AND sort directories/files with underscore first. Here is an example: _folder2 folder2 _file2 file I can sort directories first ...
1
vote
2answers
91 views

Does Linux represent an opened directory in the same way as an opened file?

Linux kernel represents an opened file as an entry in the file descriptor table, an entry in the v-node table, and an entry in the open file table. Does Linux kernel represent an opened directory ...
0
votes
2answers
80 views

How to store backup outside home directory [closed]

I'm using Linux Mint 19 Tara with home folder encryption enabled. Now I want to configure home backups with backup tool, but I don't want to store backup inside home directory. I don't want to store ...
1
vote
2answers
41 views

How to recursively move one file type but only when another file type is also present?

In my directory tree, some subfolders contain both *.flac and *.mp3 files, but other subfolders contain only *.mp3 files. I'd like to move all of the *.mp3 files to another destination (a different ...
6
votes
6answers
458 views

Checking for the existence of multiple directories

I want to check for the existence of multiple directories, say, dir1, dir2 and dir3, in the working directory. I have the following if [ -d "$PWD/dir1" ] && [ -d "$PWD/dir2" ] && [ -...
2
votes
2answers
50 views

how to find the real path of folder with regular expression

presto is distributed SQL query engine , and when we installed the presto then it should be created the following home folder /application/DB/presto/presto-server-0.216 so we can say that in ...
0
votes
3answers
48 views

Move or rename subfolders

I have a folder structure like this: /ms/files/a/ /fb/files/a/ /db/files/a/ It should be like this: /ms/files/b/ /fb/files/b/ /db/files/b/ I can find the folders I need to move or rename using ...
0
votes
1answer
16 views

How can I use SFTP to transfer a directory to my local PC, but make the transfered directory have a different name on my local PC?

I'm going to do a reinstall on my laptop and want to backup my .config. But the issue is that when I tried to do it I think it replaced my desktops .config because they both have the exact same path.(...
0
votes
2answers
21 views

Copy specified subdirectories

I have a bunch of folders in an external HDD and I want to copy a part of them. The folders have the following structure: A001A A003A A004A etc... ...and all the folders contain similar directories ...
6
votes
2answers
645 views

Why is the size of a directory either 0 or 4096? [duplicate]

$ ls -l total 28 drwxrwxrwx 1 t t 4096 May 8 2018 dir1 drwxrwxrwx 1 t t 0 Mar 12 2015 dir2 drwxrwxrwx 1 t t 4096 Jan 17 2014 dir3 drwxrwxrwx 1 t t 4096 Jun 12 2017 dir4 drwxrwxrwx 1 t t ...
-1
votes
2answers
548 views

bash: cd: <path> : No such file or directory [duplicate]

I upgraded to the latest version of Kali Linux and all of a sudden I can't open up files. The file manager shows the files exist and I can get in them through the file manager but cannot do so through ...
0
votes
1answer
32 views

Trying to save a photo with python, but when I execute the program with the terminal, It returns that there is no such directory [closed]

I have been trying to execute this program: 1 import PIL as pillow 2 from PIL import Image, ImageFilter 3 photo = Image.open("index.jpeg") 4 b = photo.filter(ImageFilter.BLUR) 5 b.save("/home/...