Tag Info

Hot answers tagged

14

Creating a test Ext4 filesystem: First make a filesystem on a file to avoid corrupting your real filesystem: dd if=/dev/zero of=test_fs bs=10M count=1 This will create a file called test_fs with a size of 10 megabytes. Then we will create a Ext4 filesystem on it: mkfs.ext4 test_fs Putting some files on it: We have a fully functional filesystem. ...


5

Whether or not anything was found, find always returns true. You can use grep to determine if find found something: read -r a if find . -maxdepth 1 -name "$a" -print -quit | grep -q . then echo "You found the file" else echo "You haven't found the file" fi Quitting after the first match (-print -quit) should improve performance, as Eliah has noted. ...


3

Folders are as big as the total size of their contents; they do not have any free space. The df command shows empty disk space.


2

There is no meaning of a folder size. In really a folder/directory is just a File in Linux as the concept everything is a file in Linux. So a folder is a file of files. I,e it's just a place to hold files, though it has no size, its size is related to the size of files inside. So, there is nothing called free space on a folder. You can know the size of a ...


2

Bellow you can see me make a test folder and change the ownership of that folder to another user. I cannot create a file if the directory isn't owned by me. Similarly, as testuser, I couldn't remove a test file owned by my account. But as you see, if a user can run sudo, that user can change ownership of the folder, change file permissions, and thus - view ...


2

If don't have to use the find command, using the test command (or its short form [...]) would be easier, IMHO. With test, the e switch does what you're looking for. #!/bin/bash read -r a if [[ -e $a ]]; then echo "You found the file" else echo "You haven't found the file" fi But be aware that test only looks for the file in the current directory, ...


2

These are the effects of a PrivateTmp setting in a service unit. You will find that your rtkit-daemon.service and colord.service units employ that very setting. For why that is, you will have to consult the people who wrote those service unit files. PrivateTmp is after all a band-aid to cover over security holes left by the ways that some programs use ...


1

Press CtrlL, enter the address to the desired directory, and press CtrlD.


1

Here's my analysis and suggestions based on what's going on. It looks like you have two Windows partitions-a recovery partition, and main one. Both are on /dev/sda1 and /dev/sda2. They are NTFS. You have two Linux partitions-swap and ext4. This is also normal. The only difference between your fstab and mine is the presence of /proc/. I have not seen ...


1

Perhaps inotify and dnotify is the way to go...: https://lwn.net/Articles/604686/ This in not the easiest way of watching filesystem activities - but its the lowest level that is reachable for the user that is scriptable - from my opinion. escpeacially the fschange command is helpful. according to http://stefan.buettcher.org/cs/fschange/index.html the ...


1

You can execute script with ./ if you are in same directory as script. But if you want to run it from anywhere , you have to put the script into one of the folders listed in your $PATH preferably /usr/bin or add a custom folder to the list. As for creating a file, if you specify full path to script , like nano /usr/bin/myscript.sh , yoi don't have to be ...


1

To see a file (not its contents, only the file itself), you need to have read permission for the file's parent directories. There are no "view" permissions. As long as you can read a directory, you will be able to see all the files in it. Whether or not you can modify the file or read its contents will depend on whether you have execute permissions on the ...


1

In your home folder is a configuration file ~/.config/user-dirs.dirs: nano ~/.config/user-dirs.dirs with a content like this: [..] XDG_DESKTOP_DIR="$HOME/Desktop" XDG_DOWNLOAD_DIR="$HOME/Downloads" XDG_TEMPLATES_DIR="$HOME/Templates" [..] You can comment out the line by which the folder will automatically create: before: ...



Only top voted, non community-wiki answers of a minimum length are eligible