date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,404,054,539,000 |
I realised that pdftk does not update the PageLabel metadata, when using update_data_utf8. I've got a pdf file (let's call it file.pdf), which contains the metadata
PageLabelBegin
PageLabelNewIndex: 1
PageLabelStart: 1
PageLabelNumStyle: LowercaseLetters
PageLabelBegin
PageLabelNewIndex: 3
PageLabelStart: 1
PageLabelN... |
You are not doing anything wrong, pdftk never supported updating page labels (although the code suggests it was a planned feature). If you want to keep using software based on pdftk I suggest the fork pdftk-java, which implements this missing feature. Disclaimer: I maintain pdftk-java.
| pdftk does not update PageLabel metadata |
1,587,536,926,000 |
If I touch a new file, I see that its modification time is showing as the current time in my local time-zone rather than in UTC. If I were to copy that file to a machine that's in another time-zone, would it update to that machine's time-zone or would it still show the same time it showed on my machine? Do file modifi... |
They should be in Unix time: Seconds since 1970-01-01T00:00 UTC. If you move it then it will be the same time. However time is displayed in local time.
The above is true on Unix file-systems. On at least some Microsoft file-systems the time is stored in local time (for backward compatibility with MS operating systems)... | Are file modification times in UTC or in the local time zone? |
1,587,536,926,000 |
I tried to code a bash script that loops through a given directory and all its subdirectories and extracts metadata attributes with the mdls command into separate text files. Since I have a lot of filenames containing spaces and other special characters, my code base is derived from the answer "Looping through files w... |
The read line </dev/tty command is reading a line from the terminal
(i.e., the keyboard).
If you don’t want to do that, delete that command.
Does the loop seem to be working well aside from that?
(At a glance, it looks pretty much OK to me.)
If not, edit your question to say what happens.
-name '*.*' says to look ... | Bash script for writing metadata attributes of files into separate text files |
1,587,536,926,000 |
I have over 80,000 photos that have been given proper EXIF keywords but Google Drive requires data in the Description for it to be searchable in their online app. I need to copy the contents of the Keywords entry to the description on this mass of photos that goes deep into sub directories.
|
Using ExifTool you could just run:
exiftool -TagsFromFile file.jpg '-Keywords>Description' file.jpg
You can find more info in the manpage for exiftool.
| Copy EXIF meta data from the Keywords to the Description on a huge amount of photos in sub folders |
1,587,536,926,000 |
This is just my comment from How to cache or otherwise speed up `du` summaries? formulated as a question of its own:
Are there any extended discussions about creating a filesystem in which the total size of each directory (think du) is saved and "bubbles up" (i.e., is propagated upwards in the tree so that all parent ... |
Modern filesystems such as zfs / btrfs / bcachefs actually go in an opposite direction and allow / encourage sharing extents between files. With this, the notion of "how much data does a directory occupy" becomes less well-defined (though this was already true to some extent due to hard links): using reflinks, it's po... | Filesystem with "bubbling" directory size |
1,587,536,926,000 |
When doing an mp3 → mp3 (or flac → mp3) conversion, -map_metadata can be used to copy metadata from the input file to the output file:
ffmpeg -hide_banner -loglevel warning -nostats -i "${source}" -map_metadata 0 -vn -ar 44100 -b:a 256k -f mp3 "${target}"
However, when I use this, I notice that it doesn't copy all th... |
The front cover is treated as a video stream with a special disposition. Use of -vn will disable its processing.
Use
ffmpeg -hide_banner -loglevel warning -nostats -i "${source}" -map_metadata 0 -c:v copy -disposition:v:0 attached_pic -ar 44100 -b:a 256k -f mp3 "${target}"
| ffmpeg not copying FRONT_COVER image metadata during conversion |
1,587,536,926,000 |
In our company we have a shared Windows folder. If I access it from Windows, I can pop up Properties menu of a file and find its metadata: who created it, last access times and so on.
On linux I have this folder mounted with mount -t cifs. I want to write a script which grabs some stats about folder usage.
Is there an... |
You're using
mount -t cifs //data/Shared /mnt/Shared -o uid=1000,gid=1000,user=<my_windows_account_name>,dom=<my_domain>,pass=
What this tells the local system is two-fold:
Authenticate to to the remote server with the credentials specified as the tuple { user, domain, password }
Fake all accesses to/from the rem... | How can I fetch file metadata on cifs mounted folder? |
1,587,536,926,000 |
I have a folder with opus sound files. I would like to convert that folder listing to something I can use in a spreadsheet. I want the result to contain something like file name, length of the sound and file size. How can this be done?
|
I'd have recommended exiftool for that as it can extract metadata from most types of files and format it in csv:
exiftool -csv -FileSize -Duration -- *.opus > list.csv
But at least my version of exiftool doesn't seem to support extracting duration from opus files. As mentioned by @dodrg, ffprobe can though and also s... | Convert directory with opus files to CSV or similar? |
1,587,536,926,000 |
I would like to
search for "ytversion",
replace it with "mqversion"
in the title tag
of multiple mp3 files. I would like this process not edit/delete any other parts of the metadata content.
Is this possible? If yes, which tools would I have to use?
I know I can search for a certain string in the metadata of mul... |
You can do this using the id3v2 tool, which should be in the repositories for your operating system (note that this solution assumes GNU grep, the default if you are running Linux):
## Iterate over all file/dir names ending in mp3
for file in /path/to/dir/with/mp3/files/*mp3; do
## read the title and save in the ... | Is it possible to search for a string and replace it with another string in the title tag of multiple mp3 files? |
1,587,536,926,000 |
What I understand is, you could change the permission of a file for its owner by, say
chmod u=0 file.txt
In this case, we removed r, w and x permission for the owner of this file.
But under what circumstances would we like to do that? If you are the file owner, why would you like to downgrade the permission of your ... |
It is not against an intelligent actor, because as owner, they could chmod() the file any time, giving their permissions back.
It might be useful against programs, if you want to avoid your own programs to play with some of your file on any reason.
However, typically it is more feasible to simply move that file away.
... | Under what circumstances would a user/superuser change the permission of a file for its owner? [closed] |
1,587,536,926,000 |
Many Linux players (like Audacious, Banshee, Amarok, Exaile) can easily access audio CDs tracks info (names and other metadata) but Deadbeef cannot, although it has a cdda plugin that should do just that.
Along VLC, Amarok, Rhythmbox, Xine and Kaffeine, Deadbeef is one of the players that can read CD-Text (tracks in... |
The problem is with the option "Prefer CD-Text over CDDB" (under Preferences-Plugins-Audio CD player-Configure): that should NOT be checked.
When it was, instead of preferring CD-Text when available, it just showed CD-Text and never CDDB info. And as CD-Text is usually absent, it showed generic names of tracks ('Trac... | Deadbeef audio player does not retrieve online (freedb, CDDB) info about CD tracks |
1,587,536,926,000 |
I have a bunch of files that have just hashes as names and no file endings. (It's an iPhone backup to be precise.) I know there are SQLite databases amongst these files.
How do I find them?
|
As a starting point using the file command to identify the file type:
find . -print0 | xargs -0 file
Result:
./.X11-unix: sticky directory
./.Test-unix: sticky directory
./test.db: ... | How do I find all sqlite databases inside a bunch of files without file endings? |
1,587,536,926,000 |
I need to generate a list of all files and directories with their permission and owner e.g.
-rw-rw-r-- black www-data foo/
-rw-r--r-- black www-data foo/foo.txt
-rw-rw-r-- black www-data bar/
-rwxrwxr-x black www-data bar/foo.sh
I need this list to compare it with another instance where I ... |
If you have GNU find, you can use its printf action:
find . -printf "%M %u %g %p\n"
This will list all files in the current directory and any subdirectories, with their type and permissions in ls style, owner and group, and full name starting from the current directory.
If you want consistent spacing, you can use fie... | Get list of all files and directories with their permission and owners |
1,587,536,926,000 |
I'm studying the Ext4 filesystem and am confused by the 128 byte inode size because it appears to conflict with the last metatdata value it stores which is supposed to be offset at byte 156.
In this documentation it states that inodes are 128 bytes in length. I called dumpe2fs on an unmounted /dev/sdb1. The dumpe2fs... |
it states that inodes are 128 bytes in length
No. It states that [emphasis mine]:
[…] each inode had a disk record size of 128 bytes. Starting with ext4, it is possible to allocate a larger on-disk inode at format time for all inodes in the filesystem to provide space beyond the end of the original ext2 inode. The ... | Why do inode offset values appear to exceed inode size? |
1,587,536,926,000 |
When we bought a N Giga Byte flash memory, the free space that the OS provide for us, is less than N GigaBytes. For example, for a 2 GB flash memory, total space that we can use, is 1.86 GB.
As far as I know, the difference is for metadata. Is that right?
My question :
Is there any command or program in linux, to se... |
The manufacturer sold you the 2GB USB stick as 2 Gigabytes, meaning 2000000000 bytes. Your computer is showing the stick in units of Gigibytes. 1 Gigibyte is 1024 x 1024 x 1024 bytes, which is 1073741824 bytes.
If you divide your 2000000000 by 1073741824 you'll end up with 1.86264514923095703125 or, rounded to two d... | Use/See whole the flash memory space |
1,587,536,926,000 |
Imagemagick 6.9.11-60 on Debian. How to print date & time the photo was taken on the image? (on existing images). I have set this option in camera settings, but it only applies to new photos. The date is on the image medatada. It should be actual date the photo was taken, not the date it was saved on PC harddrive.
|
A lot will vary depending on the images you have and the meta-data they hold, but for example with ImageMagick you can imprint the EXIF date and time from myphoto.jpg with
magick myphoto.jpg -fill black -undercolor white -pointsize 96 -gravity southeast \
-annotate 0 ' %[exif:datetime] ' output.jpg
If you don't have... | Imagemagick, how to print date the photo was taken on the image |
1,587,536,926,000 |
I recovered images from an android LOST.DIR folder.
The data recovered successfully, now I'd like to set the modified timestamp of the file to be equal to the created on value of the binary data.
I'm using Ubuntu 19.10
In this case, I'd like both modified and created on to equal 2019:06:03, the format doesn't matter... |
You need an EXIF tool to retrieve the image creation timestamp, then use touch to set the filesystem timestamp accordingly.
I just tried this shell script (e.g. ex.sh) under ArchLinux where I installed perl-image-exiftool
#! /bin/bash
for fn; do
ls -l "$fn"
touch -m -t "$(exiftool -createdate -d '%Y%m%d%H%M.%... | How to set modified file's metadata to equal the created_on value of recovered images? |
1,587,536,926,000 |
I need to upload my photos to Shutterfly, but they don't seem to support EXIF data on PNG/BMP images. I need to thus convert to JPG for some prints, but I want to lose as little information as possible because the prints will be large format.
Is there any way to efficiently bulk convert PNG/TIFF images to JPG with a m... |
Using imagemagick you can set the quality of output images like this"
convert input_file.bmp -quality 90 output_file.jpg
Of course you can set quality to 95 (or even to 100) to check the result, but IMHO 90 is very good value (and balance between quality and size). If you want to do bulk conver you can use command:
m... | Bulk convert from PNG/TIFF to JPG with minimal loss in quality |
1,587,536,926,000 |
When I'm overwriting one file with another one, not only it's modification time updates, but also birth time, which is unwanted.
I want to make Dolphin overwrite files that way, so target's birth time will stay the same the same as it was before overwriting.
But, if it's impossible to configure Dolphin that way, any o... |
Birth time can’t be set arbitrarily, other than by setting the “context” time (system time typically). This means that it isn’t possible to copy a file to another and have the copy preserve the original’s birth time. (See Why does this use of `cp -a` not preserve creation time? for details.)
It is however possible to ... | How to preserve file creation date when overwriting files? |
1,587,536,926,000 |
Using Ubuntu 20.04, I can right-click on a jpg and select 'properties'. A window will open containing the tab 'image'. In this tab, there is a section called 'Keywords', the content of which I would like to receive from the terminal. I tried identify -verbose example.jpg, exif example.jpg, file example.jpg, but none o... |
Let's try this option, using the exiv2 tool:
sudo apt install exiv2
Then we can print the XMP data like this:
$ exiv2 -P X image.jpg
Xmp.iptc.Keywords XmpBag 1 Some tag
| Extract jpg property 'keyword' from terminal |
1,587,536,926,000 |
I find the opusenc command (from the opus-tools package in Debian) to edit Opus files metadata.
But, according to his man’s synopsis (and other sections in the man) it doesn’t provide a way to edit album_artist tag (like metaflac fro flac files or id3v for mp3 files):
opusenc [ -h ] [ -V ] [ --help-picture ] [ --... |
OPUS does not support tags. At all. It is a pure encoding format designed for streaming.
https://datatracker.ietf.org/doc/html/rfc6716
For storage, opus is usually converted to ogg - it does support tags. And ogg container can have an opus file directly, so the conversion is very easy and fast.
As variant you can conv... | Add “album_artist” tag to an opus file |
1,587,536,926,000 |
I have directory of recording with
foo - bar-202009.opus
unix - tilde-2020se.opus
stack - exchange-29328f.opus
I trying to set meta from file name
for foo - bar.202009.opus
(there are some inconsistency with -
so easy way is scrapping -<6digitchars>.opus)
song title = foo - bar
Using sed to scrap,
$ ls | sed 's/-[a... |
Avoiding ls parse, one-liner.
#!/bin/sh
for file in *; do
scrap="$(echo $file | sed 's/-[a-zA-Z0-9]*\w//g; s/.opus//g')"
id3tag --song="${scrap}" "${f}"
done
| ID3tag - Script for extracting metadata from filename |
1,587,536,926,000 |
Hello I am writing a bash script, this script must give ID to pdf file. How do I solve the this, is there a way?
Example as using bash shell.
Document ID is:
$ exiftool example.pdf | grep 'Document ID'
Document ID : uuid:d037451d-240e-4d82-ba6d-92390b1d2962
For example:
$ pdftool --setDocID "newID" example.pdf... |
exiftool -DocumentID="uuid:$newID" example.pdf
see examples on man exiftool
| How to I set document ID or ID to PDF file via terminal? |
1,391,337,837,000 |
It seems I am misusing grep/egrep.
I was trying to search for strings in multiple line and could not find a match while I know that what I'm looking for should match. Originally I thought that my regexes were wrong but I eventually read that these tools operate per line (also my regexes were so trivial it could not b... |
Here's a sed one that will give you grep-like behavior across multiple lines:
sed -n '/foo/{:start /bar/!{N;b start};/your_regex/p}' your_file
How it works
-n suppresses the default behavior of printing every line
/foo/{} instructs it to match foo and do what comes inside the squigglies to the matching lines. Replac... | How can I "grep" patterns across multiple lines? |
1,391,337,837,000 |
I would like to list the files recursively and uniquely that contain the given word.
Example: Checking for word 'check', I normal do is a grep
$ grep check * -R
But as there are many occurrence of this word, I get a lot of output. So I just need to list the filenames that contain the given search word. I guess some ... |
Use the -l or --files-with-matches option which is documented as follows:
Suppress normal output; instead print the name of each input file
from which output would normally have been printed. The scanning
will stop on the first match. (-l is specified by POSIX.)
So, for you example you can use the ... | List the files containing a particular word in their text |
1,391,337,837,000 |
I occasionally search through files in vim or less using / or ? but as far as I can tell, the search patterns are case sensitive.
So for example, /foo won't find the same things that /FOO will. Is there an way way to make it less strict? How can I search in vim or less for a pattern that is NOT case sensitive?
|
In vi or vim you can ignore case by :set ic, and all subsequent searches will consider the setting until you reset it by :set noic. In less there are options -i and -I to ignore case.
| How can I search in vim for a pattern that is NOT case sensitive? |
1,391,337,837,000 |
I have a font with the name Media Gothic. How can I find the file name of that font in Linux? I need to copy that file to another system. I've tried:
find /usr/share/fonts/ -name '*media*'
But this gives no results. gothic gives some other fonts. TTF is a binary format so I can't use grep.
|
Have you tried ?
fc-list | grep -i "media"
Also give a try to fc-scan, fc-match
| Find font file from font name on Linux |
1,391,337,837,000 |
I had downloaded a video a few months back. I'm not very well remembering the name by which it is saved. Is there any command or any method that will output only video files so that I can search for my video there? From man pages, I couldn't find any option of find doing that work.
The video file I downloaded may hav... |
The basic idea is to use the file utility to determine the type of each file, and filter on video files.
find /some/directory -type f -exec file -N -i -- {} + |
sed -n 's!: video/[^:]*$!!p'
This prints the names of all files in /some/directory and its subdirectories recursively whose MIME type is a video type.
The fi... | How to search for video files on Ubuntu? |
1,391,337,837,000 |
I want to find all *.h,*.cpp files in folders with defined mask, like */trunk/src*. So, I can find separately *.h and *.cpp files:
find . -path "*/trunk/src/*.h"
find . -path "*/trunk/src/*.cpp"
What is the best way to get the file-list both of types (*.h and *.cpp)?
PS I'd like to pipe the list to grep.
|
You can use -o for "or":
find . -path '*/trunk/src/*.h' -o -path '*/trunk/src/*.cpp'
which is the same as
find . -path '*/trunk/src/*' \( -name '*.h' -o -name '*.cpp' \)
If you want to run grep on these files:
find . \( -path '*/trunk/src/*.h' -o -path '*/trunk/src/*.cpp' \) -exec grep PATTERN {} +
or
find . -path ... | Get list of all files by mask in terminal |
1,391,337,837,000 |
given the following structure:
oz123@debian:~/ $ tree .
.
├── a
│ ├── a1
│ ├── a2
│ └── a3
├── a1
│ ├── a11
│ ├── a12
│ └── a31
├── b
│ └── b1
│ ├── b11
│ │ └── b21
│ │ └── b31
│ ├── b12
│ └── b3
└── c
16 directories, 0 files
How do I find all the end nodes?
I foun... |
As an addition to your own solution with -links, I want to just add that it will not work on filesystems that do not follow the Unix directory-link convention. From man find on option -noleaf these are at least CD-ROM, MS-DOS filesystems and AFS volume mount points.
For a reference, this question was already discussed... | find all end subdirectories in a tree |
1,391,337,837,000 |
If I want to search a file in the system I use the following command:
sudo find `pwd` -name filename.ext
I want to make an alias for an easier word like search, so I used the command:
alias search "find `pwd` -name "
The problem is that the command translates the pwd part to the actual path i'm in now. When i type ... |
Use single quotes to avoid shell expansion at time of definition
alias search='find `pwd` -name '
| Trying to use `pwd` inside an alias giving unexpected results [duplicate] |
1,391,337,837,000 |
I have a large music collection stored on my hard drive; and browsing through it, I found that I have a lot of duplicate files in some album directories. Usually the duplicates exist alongside the original in the same directory.
Usually the format is filename.mp3 and duplicate file is filename 1.mp3. Sometimes there m... |
There is such a program, and it's called rdfind:
SYNOPSIS
rdfind [ options ] directory1 | file1 [ directory2 | file2 ] ...
DESCRIPTION
rdfind finds duplicate files across and/or within several directories.
It calculates checksum only if necessary. rdfind runs in O(Nlog(N))
time with N being the numbe... | Search and Delete duplicate files with different names |
1,391,337,837,000 |
I want to search for the lines that contains any of the following characters:
: / / ? # [ ] @ ! $ & ' ( ) * + , ; = %
|
grep "[]:/?#@\!\$&'()*+,;=%[]"
Within a bracketed expression, [...], very few character are "special" (only a very small subset, like ], - and ^, and the three combinations [=, [: and [.). When including ] in [...], the ] must come first (possibly after a ^). I opted to put the ] first and the [ last for symmetry.
T... | Search for special characters using grep |
1,391,337,837,000 |
I need to find all xml-files that are placed in folders named config. Also config must be somewhere under a folder named trunk. For example, I am interested in all files like below:
~/projects/e7/trunk/a/b/c/config/foo.xml
~/projects/d/trunk/config/bar.xml
~/projects/trunk/config/other.xml
~/projects/e/e/e/trunk/e/e/e... |
That's not a regex. For globs one should use the -path predicate instead.
| How to find files with a certain subpath? |
1,391,337,837,000 |
I attempted find -name 'a*' 'z*' '*a' '*z'
but it gave me the error code find: paths must precede expression: z*
I know how to find files starting with a though z, or ending with a-z, but not starting with specific letters.
|
Assuming I understood your question, you are possibly overcomplicating it.
This should do
find your_directory -type f -name '[az]*[az]'
This omits files whose name is a single letter a or z. If you also want to include them, you need to specify another pattern: the name must match either [az]*[az] or [az].
find your_... | How search for a file beginning with either a or z and ending with a or z? |
1,391,337,837,000 |
In our working group we used Recoll on a Ubuntu PC to index all the PDF. For a while we moved everything to a Redhat server. Is there a Recoll alternative which doesn't requires a GUI adn support searching through a web interface?
|
You can use Recoll from the command line if you want so.
| What tools can I use for PDF indexing? |
1,391,337,837,000 |
I want to check the absence of the following sequence of characters $$$$$ (i.e., 5 dollar signs) in a json file using grep as it has been used instead of comma to separate fields and I need to make sure this did not cause conflicts with existing similar sequence.
However, when I grep $, I get similar number of lines.... |
It seems that $ is a special character for end of line?
Yep, exactly. And there's an end-of-line on each and every line.
You'll need to use \$\$\$\$\$ as the pattern, or use grep -F '$$$$$', to tell grep to use the pattern as a fixed string instead of a regular expression.
Or a shorter version regex pattern: \$\{5\}... | How to grep '$$$$$'? [duplicate] |
1,391,337,837,000 |
I have a large set of files in a directory. The files contains arbitrary text.
I want to search for the file name inside that particular file text. To clarify, I have file1.py.txt (yeas, two dots .py.txt) and file2.py.txt both contains texts. I want to search for the existence of the string @code prefix.file1.py insid... |
With GNU awk:
gawk '
BEGINFILE{search = "@code prefix." substr(FILENAME, 3, length(FILENAME) - 6)}
index($0, search)' ./*.py.txt
Would report the matching lines.
To print the file name and matching line, change index($0, search) to
index($0, search) {print FILENAME": "$0}
Or to print the file name only:
inde... | Searching for a string that contains the file name |
1,391,337,837,000 |
I'm working with XML files, each of which could be dozens of lines long. There are literally hundreds of these files, all over a directory structure. Yes, it is Magento.
I need to find the file that has the <foo><bar><boom><bang> element. A <boom><bang> tag could be defined under other tags, so I need to search for th... |
You could try xmlstarlet to select if the path exists then output the filename:
find . -name '*.xml' -exec xmlstarlet sel -t -i '/foo/bar/boom/bang' -f -n {} +
| Find XML file with specific path |
1,391,337,837,000 |
I have a directory structure as follows:
dir
|___sub_dir1
|_____files_1
|___sub_dir2
|_____files_2
|___sub_dirN
|_____files_N
Each sub_directory may or may not have a file called xyz.json. I want to find the total count of xyz.json files in the directory dir.
How can... |
You can use :
find path_to_dir -name xyz.json | wc -l
| get count of a specific file in several directories |
1,391,337,837,000 |
I want to search for arbitrary file/directory names, but only want to list file paths containing the search string at the same position once.
Especially not every file within a directory matching the search string.
Here is an example, locate -i flatpak lists:
/etc/flatpak
/etc/dbus-1/system.d/org.freedesktop.Flatpak.S... |
Sounds like you want to search for flatpak in the file name only (and not in other path components), so you can use the -b/--basename option:
So:
locate -ib flatpak
Another approach could be to use the -r/--regex option and write:
locate -ir 'flapak[^/]*$'
That is flatpak followed by any number of characters other t... | Search for arbitrary files but only list matches in results once |
1,391,337,837,000 |
I'm writing a bash script and I need to create an array with the 10 most recent image files (from new to old) in the current dir.
I consider "image files" to be files with certain extensions, like .jpg or .png. I only require a few specific image types to be supported, I can also express this in one regex like "\.(jp... |
The correct syntax is:
list=($(ls -t *.jpg *.png | head -10))
echo First element: ${list[0]}
echo Last element: ${list[9]}
However, this solution will have problems with file names containing space characters (or any white space in general).
| bash command to create array with the 10 most recent images in a dir? |
1,391,337,837,000 |
Is it possible to scan entire filesystem (or some recursively some directory) for files created by user with specific $UID created during last 5 minutes ?
For examle, `show me files from /home/ which be created by root during last 5 minutes ?
|
Yes, try :
find /home -uid 0 -mmin -5 -print
the final -print is not mandatory, it depends of your implementation of find.
| Find files created by UID during last 5 minutes |
1,391,337,837,000 |
This has happened to me twice (EDIT: many times and I can replicate it) now. I'm working on a Raspberry Pi, looking for a file I already know exists and so I type this command:
sudo find / -iname 'firefox_binary.py'
The first time I type it, it runs without errors, but it doesn't find the file. However, when I run t... |
This is a real bug found in find version 4.4.2, but the bug has been fixed in find version 4.6.0.
| How is it that the same find command can give two different results? |
1,391,337,837,000 |
This answer on opening all files in vim except [condition]:
https://unix.stackexchange.com/a/149356/98426
gives an answer similar to this:
find . \( -name '.?*' -prune \) -o -type f -print
(I adapted the answer because my question here is not about vim)
Where the negated condition is in the escaped parentheses. Howeve... |
First, note that -not is a GNU extension and is the equivalent of the standard ! operator. It has virtually no advantage over !.
The -prune predicate always evaluates to true and affects the way find walks the directory tree. If the file for which -prune is run is of type directory (possibly determined after symlink r... | Difference between GNU find -not and GNU find -prune -o -print |
1,391,337,837,000 |
I accidentally deleted some files spread across my home directory, but I do not know exactly which ones were removed. How can I get a list of all backup files missing their corresponding file? (equivalently, files having names ending with a tilde, without there being another file in the same directory with the same na... |
Just find all files with a tilde, remove the tilde and look for the "original":
find . -name '*~' -print0 | while IFS= read -r -d '' file; do
[ -e "${file%\~}" ] || echo cp "$file" "${file%\~}"; done
done
Explanation:
find ~/ -name '*~' -print0 : find all files in $HOME that end in a tilde and print them with... | How to list backup files missing corresponding real files? |
1,391,337,837,000 |
I want to list the files that contain a pattern,
without outputting the line(s) containing the pattern.
I assume that it's possible to do this with grep.
How should I use grep in that sense?
For example, the following command
gives all the lines containing "stringpattern" (case insensitive)
in all the .txt files.
... |
If you need only files that match:
grep -lie pattern -- *.txt
I don't think that you can use only grep to print only files and line numbers, because with option -n, it outputs on every line 'file:line:match'. If the file names don't contain : nor newline characters, you can though pipe this to cut to get only what yo... | Only output the name of file containing a pattern (without the line output) using grep |
1,391,337,837,000 |
I'd like to search recursively for files with a specific Change date. Note, this is not the Access or Modify date, but the Change date as outputted by stat.
#stat prototype.js
File: `prototype.js'
Size: 175637 Blocks: 352 IO Block: 4096 regular file
Device: 803h/2051d Inode: 18146171 Links: 1
Ac... |
The command that sufficed was:
find . -type f -newerct 2016-07-23 ! -newerct 2016-07-24
| Find files by change date [duplicate] |
1,391,337,837,000 |
I have got tons of directories with thousands files of various filetypes:
dir
|__ subdir
| |__ file.foo
| |__ file.bar
| |__ file.txt
| |__ (...)
|__ (...)
What is fast and efficient way to move from all subdirs all .txt files wich has 2 or more lines to other, selected directory?
|
On a GNU system:
find dir -type f -name '*.txt' -exec awk '
FNR == 2 {printf "%s\0", FILENAME; nextfile}' {} + |
xargs -r0 mv -t newdir
(note that it may cause files with the same name to overwrite each other. A single invocation of GNU mv will guard against that, but if xargs invokes several, then it could be... | Move specific files from multiple directories |
1,391,337,837,000 |
In order to store attachments, a /path/to/atts/ directory will have numerous child-directories (product IDs) created (from 1 to ~10,000 or maybe more in the future), and in each of this subdir, 1 to ~10 attachment files will be created.
In /path/to/atts/
1
├── file1.1
├── file1.2
└── file1.3
2
└── file2.1... |
You can read about the hash tree index used for directories here.
A linear array of directory entries isn't great for performance, so a new feature was added to ext3 to provide a faster (but peculiar) balanced tree keyed off a hash of the directory entry name.
| 'cd' complexity on ext4 |
1,391,337,837,000 |
I like to search all PHP files and find a particular string that is identified by a regular expression.
The regular expressions that I use to find the string is:
\$[a-zA-Z0-9]{5,8}\s\=\s.{30,50}\;\$[a-zA-Z0-9]{5,8}\s\=\s[a-zA-Z0-9]{5}\(\)
I tried to use:
grep -r "\$[a-zA-Z0-9]{5,8}\s\=\s.{30,50}\;\$[a-zA-Z0-9]{5,8}\s... |
Since you are using grep to search using a regular expression, you have to be aware that grep by default interprets the search string as basic regular expression (BRE). The syntax you use contains extended regular expression (ERE) syntax, so you would need to use the -E flag.
Copying the string example you posted into... | Find recursively all files whose content match a specific regular expression |
1,391,337,837,000 |
How would I go about finding all files recursively that have ACLs different from what I'm searching for? For example I would like to find all files in a directory that have ACLs that are not identical to the following example:
# owner: bob
# group: bobs-group
user::rwx
user:fred:rwx
group::rw-
mask::rwx
other::r--
... |
You may use find and a diff.
Save the desired reference permissions in a file, e.g. perref
$cat perref
# owner: bob
# group: bobs-group
user::rwx
user:fred:rwx
group::rw-
mask::rwx
other::r--
Do some find-magic by simply comparing the output of getfacl with the reference and negating matches. As this needs to cu... | Find Files Recursively With Different ACLs |
1,391,337,837,000 |
I have an HTML file on a Linux server that contains a long list of links. I am trying to edit this file as follows.
Find original occurrences of this type: http://www.test.org/name
Replace them with: http://www.test.org/archive/name
How can I do this? I have tried running:
sed -i -e 's/http://www.test.org/name/http://... |
/ is default sed subexpression separator, use another one:
sed -i 's~http://www.test.org/name~http://www.test.org/archive/name~g' user.html
| Replacing a Part of URL String in a Linux File With Another String |
1,391,337,837,000 |
Is there a CLI tool similar to gnome-search-tool?
I'm using locate, but I'd prefer that it grouped results where directory name is matched. I get a lot of results where the path is matched which is not what I want:
/tmp/dir_match/xyz
/tmp/dir_match/xyz2/xyz3
It needs to be fast and thus use a search index.
|
locate is very versatile can take -r and a regexp pattern, so you can do lots of sophisticated matching. For example, to match directories a a0 a1 and so on use '/a[0-9]*/'. This will only show directories with files in them since you need the second / in the path. To match the directory alone use $ to anchor the pa... | Simple CLI tool for searching |
1,391,337,837,000 |
I have a set of files containing boot variables from several cisco switches in the network. I have an requirement to filter only the switches with the boot variable empty on the next reload and print the hostname
given this data
hostname1#show boot
---------------------------
Switch 1
---------------------------
Curr... |
awk '{a[++i]=$0}/BOOT variable =.$/{for(x=NR-10;x<=NR;x++)print a[x]}' filename|awk '/^hostname/||/BOOT variable =.$/{print $0}'| sed "s/#.*//g"
Results in:
hostname1
BOOT variable =
| How to match for an empty string in a grep pattern search? |
1,391,337,837,000 |
I have a folder with big files (few GB each). I would like to search aPATTERNthrough these files. I can do this with grep or ack:
$ grep -n 'PATTERN' /path/to/files/*.log
Now, I have a list with all lines including PATTERN. However, I need some area includes these lines to see context: few lines before PATTERN occurs... |
With gnu grep
grep -B <number_lines> -A <number_lines> -n 'PATTERN' /path/to/files/*.log
e.g. to get the 6 lines above the line grep matched, and 4 lines after it:
grep -B 6 -A 4 -n 'PATTERN' /path/to/files/*.log
From man grep
Context Line Control
-A NUM, --after-context=NUM
Print NUM lines of trailing context ... | Examine a bunch of huge files |
1,391,337,837,000 |
I have a folder with some files (snippet of the contents of the folder)
PAT1.URGRSVP.50.WR786842JOB11632.WRS20140.FILE0005.DAT
PAT1.URGRSVP.50.WR786842JOB11643.WRS20140.FILE0003.DAT
PAT1.URGRSVP.51.WR786842JOB11643.WRS29232.FILE0003.DAT
PAT1.URGRSVP.50.WR786842JOB11694.WRS20140.FILE0002.DAT
...
...
...
My focus is on... |
ls *.DAT | awk -F. '{ if (c[$3$5]) print $0 ; c[$3$5]=$0}'
In the above, awk looks at each file name using . as a field separator. If it has seen the combination of the third and fifth fields before, it prints the file name. With your file names as input, the above produces:
PAT1.URGRSVP.50.WR786842JOB11643.WRS2014... | Find duplicate file names with specific matching pattern |
1,391,337,837,000 |
I am looking for files, since I added a backup external HD. I want to continue working elsewhere, while find/grep/locate find a file. As a match is found, I'd like to be alerted so that i can stop the search, in case it was the one i intended to find.
Can there be an audible alert per match?
|
At least with GNU find, the -printf action supports a \a (terminal bell) escape char - so at its simplest you could do something like
find . -name foo -printf '\a' -print
I'm not aware of an equivalent with grep or locate.
| how can i make grep/find/locate beep as it finds each match |
1,281,554,099,000 |
I have a couple of machines at home (plus a number of Linux boxes running in VMs) and I am planning to use one of them as a centralized file server.
Since I am more a Linux user rather than a sysadmin, I'd like to know what is the equivalent of, let's say "Active Directory"? My objective is to have my files in any of ... |
You either build your own Active Directory-equivalent from Kerberos and OpenLDAP (Active Directory basically is Kerberos and LDAP, anyway) and use a tool like Puppet (or OpenLDAP itself) for something resembling policies, or you use FreeIPA as an integrated solution.
There's also a wide range of commercially supported... | What is the equivalent of Active Directory on Linux |
1,281,554,099,000 |
I haven't found a slam-dunk document on this, so let's start one.
On a CentOS 7.1 host, I have gone through the linuxconfig HOW-TO, including the firewall-cmd entries, and I have an exportable filesystem.
[root@<server> ~]# firewall-cmd --list-all
internal (default, active)
interfaces: enp5s0
sources: 192.168.10.0... |
This should be enough:
firewall-cmd --permanent --add-service=nfs
firewall-cmd --permanent --add-service=mountd
firewall-cmd --permanent --add-service=rpc-bind
firewall-cmd --reload
| NFS servers and firewalld |
1,281,554,099,000 |
I'm running a small server for our flat share. It's mostly a file server with some additional services. The clients are Linux machines (mostly Ubuntu, but some others Distros too) and some Mac(-Book)s in between (but they're not important for the question). The server is running Ubuntu 11.10 (Oneiric Ocelot) 'Server E... |
Using any mount system, you want to avoid situations where Nautilus lists the directory containing a mount that may or not be mounted. So, with autofs, don't create mounts in, for instance, /nfs. If you do, when you use Nautilus to list the 'File System' it will try to create whatever mounts should exist in /nfs, an... | automount nfs: autofs timeout settings for unreliable servers - how to avoid hangup? |
1,281,554,099,000 |
I'm currently setting up a home server using a very, very old PC. It has Ubuntu 11.10 installed on it, but it can't actually handle the GUI. I want to install the server edition of Ubuntu, which is command line only, but have no idea how to do so. What can I do?
|
Actually, if you just have problem with running the GUI there's no need to install another distribution, simply modify the startup sequence to prevent the graphical interface from coming up and work from the command line as you desire.
I don't have access to a system right now, but I believe the script you'll need wil... | How do I switch from Ubuntu desktop to Ubuntu server? |
1,281,554,099,000 |
I'm looking into installing a file server on my network, for serving data and backups.
I want this machine to be available at all times, but I would rather not keep it on all the time (as to conserve power).
Is it possible to set things up so that the thing automatically suspends (or powers off) after some time and th... |
OS X can do this now, as of Snow Leopard. It's made possible through the Sleep Proxy Service. It's pretty much automatic. The only requirement is that you have a second always-on Apple device on your LAN that can act as the sleep proxy. Their current low-power embedded boxes all support this, I believe: Airport, T... | How to power off a system but still keep it available on the network |
1,281,554,099,000 |
I would like to learn more about Linux. I briefly went through a few books and quite a few articles online, but the only way to learn something is to actually start using it.
I would like to jump in the deep end and configure a Linux server. So far I have downloaded Ubuntu Server.
I'm looking for goal or a challenge... |
Here's a couple:
run Linux as your primary operating system, on both your desktop and your laptop, if any
install KVM and virt-manager and build a couple of virtual machines
build a package for your distro of choice (a .deb or .rpm file); it helps in understanding a lot of things
build your own kernel
These might no... | A small challenge to familiarize myself with Linux [closed] |
1,281,554,099,000 |
I have a 100gig file on a remote server, what I need to do is connect to that machine and zcat that file and pipe the output of zcat to a command on a local machine... I was hoping smbclient would help but I can't seem to find a way to run a command locally but have the left side of the pipe come from a remote source.... |
smbclient -E -U $USERNAME //server/sharename $PASSWORD -c 'get \\dir\\filename.gz /dev/fd/1' 2>/dev/null | zcat | yourcommand
The -E instructs smbclient to send all messages to standard error instead of standard out where those messages will mess up the output we actually want. I'm not interested in those messages so... | Using SMB to pipe contents of file to local command on local machine |
1,281,554,099,000 |
Is there any (simple) way to deny FTP connections based on the general physical location? I plan to use FTP as a simple cloud storage for me and my friends. I use an odroid c2 (similar to raspberry pi but uses arm64 architecture) running Debian 8 with proftpd and ufw as my firewall. Ftp server runs on a non-standard p... |
Use pam and geoip module
This PAM module provides GeoIP checking for logins. The user can be
allowed or denied based on the location of the originating IP address.
This is similar to pam_access(8), but uses a GeoIP City or GeoIP
Country database instead of host name / IP matching.
| Limit FTP connections by area |
1,281,554,099,000 |
I'm very new to Unix, but after having become comfortable with bash over the past year and after having played with Ubuntu recently, I've decided to make my next computer run Ubuntu, and I think my wife is on board for her next computer as well.
Is it easy to set up a central family server so that each computer acts a... |
You can use Fish or SFTP to transfer files between computers, with minimal prior setup. Both protocols transfer files over SSH, which is secure and encrypted. They are very well integrated into KDE: you can type fish:// or sftp:// URLs into Dolphin's Location Bar, or you can use the "Add Network Folder" wizard. SFTP a... | Setting up a family server |
1,281,554,099,000 |
I have recently purchased myself an HP rack server for use as a personal fileserver. This server currently lives under my bed as I have nowhere else to put it. For those not aware (as I was not fully) this server is VERY LOUD.
I need to be able to access my files a lot of the time during the day, and due to the si... |
It seems after trial and tribulation of innumerable ways to get my server to do what it's told, the best way to solve my problem of it being loud is just to put it in the garage and hope no water damage occurs during cold nights (which it shouldn't, as the server will be on 24/7).
Thanks to everyone who offered actual... | How can I make my Linux server sleep and wake on LAN when not in use? |
1,281,554,099,000 |
I work with a couple different nodejs live servers as part of my job and there seems to be some kind of leak within my tooling/workflow causing file watchers to accumulate over time until they hit the system limit. I then get the following cli errors:
Error from chokidar (<path-to-folder>): Error:
ENOSPC: System limi... |
The command you provided is searching in /proc for any file descriptors in /proc/*/fd/ which are symlinks to anon_inode:inotify. It's pretty straightforward to also report the commands and PIDs of these processes, along with the number of watches set:
#!/bin/bash
cd /proc
for p in [0-9]*
do cd $p
if find fd -user ... | How to tackle leaking file watchers on Debian 11? |
1,281,554,099,000 |
I'm novice in linux world and I'm french, I don't have a good English. I want to create a data platform with a table in an intranet network!
So, How to set up localhost server with http protocol on apache? Exists a web directory in local on Linux? What packages should I install? How to allow other computers to connec... |
How to setup localhost server with http protocol on apache?
Its depends upon the OS you are using. if you are using Ubuntu
sudo apt-get install apache2
if you are using CentOS/Redhat
sudo yum install httpd
and start service with
service httpd start (or) service apache2 start
and check with localhost:80
you can host ... | How to set up a localhost server with http protocol on apache [closed] |
1,281,554,099,000 |
During CentOS install, there is a choise of "base environment".
I want to install a general file, DNS, mail, etc. server, but there appears to be 3 different options for servers:
Infrastructure Server
File and Print Server
Server with GUI
What are the differences between these options, and is this documented somewhe... |
Here's the environment choice for a CentOS 7 install:
The difference is in the packages being installed, and in the out-of-the-box configuration (firewall, services started at boot, etc.) So for instance, "File and Print Server" will install Samba and NFS, "Basic Web Server" will install and configure a basic httpd s... | What are the differences between options for base environment in CentOS install? |
1,281,554,099,000 |
When your University sends everyone an e-mail saying
"We're sorry! One or more of our disks have failed; thus we've lost 'x' number of home directories on our servers."
Is it basically just the root directory allocated for each student/professor/faculty-member? And also, what do they mean by "server" here?
Thanks :)
|
A user's home directory is the initial directory when a user logs in. Normally the user may create files and directories only in in home directory (apart from temporary directories). Also various settings (user specific startup files and such) are usually stored in the user's home directory.
Server is just annother na... | What exactly is a "home directory"? |
1,281,554,099,000 |
So I made a dedicated Samba file server on my Debian(3.2) machine. I have had great success accessing it from both Windows and Unix. I can SSH into it on the local network.
When I try to SSH into it via the public IP address, it says connection refused.
I would like to be able to ssh into it remotely, directing into t... |
Scriptonaut, probably your problem has nothing to do with Samba, but has to do with port forwarding/NAT. If you have your SAMBA serving Debian computer in a LAN network, behind a router, you need it configured to transfer requests to some of its ports to your SAMBA running machine:
First, I'll tell, how outgoing conn... | How do I SSH into my Samba file server? |
1,281,554,099,000 |
I have a Debian Jessie (Version 8.1) server that serves multiple domain names. Each has their own folder configured under /var/www/. Each domain name has a unique conf (example.com.conf) file under /etc/apache2/sites-enabled which is linked to a matching conf file under /etc/apache2/sites-available. Each conf file has... |
Reconfigure your config by running
# dpkg-reconfigure exim4-config
General type of mail configuration: internet site
Other destinations for which mail is accepted: example.com
IP-addresses to listen on for incoming SMTP connections: fill in your IP address
Those should be the most important items to change. Remove ... | How to configure EXIM4 to relay emails? |
1,281,554,099,000 |
I would very much like to allow users in a small office environment harness the power of slocate indexed database on the file server.
Currently when users are looking for a file in our fileserver, they need to run find from their Windows workstations on the network shares that are available from the server. This loads... |
I looked and did not find any offering that provided just a web app interface to an existing slocate database file.
So you have the following options:
Roll your own. Shouldn't be too difficult use a CGI based approach which would allow users to search for entries in your pre-built slocate database file.
Skip using t... | is there a web app for returning results to a search on an indexed database? |
1,281,554,099,000 |
I'm trying to run tnftpd on OS X, which is NetBSD's FTP server and used to be OS X's FTP server. I built and installed it from Apple's sources. Unfortunately, it seems that I cannot run the server without root privileges. These have been my approaches so far to get the server to work without root privileges:
I've tri... |
According to the man page tnftpd(8)
... The server
uses the TCP protocol and listens at the port specified in the ``ftp''
service specification; see services(5).
and a scan through ftpd.conf(5) shows no obvious means to fiddle with the listen port (as oppo... | How to run tnftpd without root on OS X? |
1,281,554,099,000 |
I'm running a personal server at home with a CentOS 7 OS and a 12TB zpool. It's been running for a couple of years and yesterday I noticed some problems so I went in to have a look.
At first it seemed like one of my drives had failed, with zpool import giving the following results:
pool: media
id: 1363376331138686016
... |
Your best bet is to destroy the pool, recreate it with a replacement for the failed drive ata-ST3000DM001-1CH166_Z1F278KB, and then restore from backup.
If that's not an option (it should be - neither ZFS nor RAID are a substitute for backups! nor were they ever intended to be), then you could try taking the zpool off... | DEGRADED zpool can't be imported with I/O error |
1,281,554,099,000 |
For research purposes, I use the University server.
The server login is a two-step process.
First, I type
ssh -p 44 [email protected]
(Altered for security reason)
Then the password is prompted. I type the credential
Then I type
ssh [email protected]
Then the password is prompted. I type the credential
Now if I h... |
rsync command can help you with:
rsync -av -e "ssh -p 44 [email protected]" [email protected]:~/first.pdf ./
The server [email protected] will be used as a proxy to reach the file on remote host. The file first.pdf will be copied on your local machine.
| How to bring back the files from a remote server (initially accessed through 2 step login) back to our local computer? |
1,281,554,099,000 |
I am trying to setup a RaspberryPi as a Plex Media Server.
The server is setup and running. I can access it via the web interface.
I want my media files in the directory /mnt/sda/will/plex.
This is the permissions of that directory:
pi@raspberrypi:/mnt/sda/will $ sudo ls -lstr
total 8
4 drwxrwxrwx 3 will root 4096 Dec... |
Take a look at the permissions on the folders at or above /mnt/sda/will. All of those folders need to have r and x permission on them. 'x' means something different on folders than files. You could probably solve the problem running the following commands:
sudo chmod a+rX /mnt
sudo chmod a+rX /mnt/sda
sudo chmod a+... | Plex Media Server cannot see sub folders.. Permissions issue? |
1,281,554,099,000 |
Preface to my Situation and Motivation
I am trying to familiarize myself with Ubuntu Server edition as I set up a home server. I am setting up a small virtual network with a hypervisor for experimenting. Now, many hypervisors do have a snapshot feature, as does mine, I still would like to learn about LVM snap shots as... |
Start with what you think is a reasonable value, and then set up LVM2's snapshot auto extension feature to cover things if something goes wrong.
LVM2 has this really neat feature that will automatically extend snapshot volumes that are nearly full without requiring any user intervention. To use it, you need to edit s... | How large should an LVM snapshot be? |
1,281,554,099,000 |
I have installed a Samba server on Ubuntu Server 12.04 so I can store files there from my desktop or laptop or whatever.
/etc/samba/smb.conf:
#======================= Global Settings =====================================
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = xxx
security = user
... |
I found that this happened because I was already logged in with a different account to the same network but a different shared directory. I left out other directories since posting the whole config was a bit too much, or so I thought..
It appears, as the error says, you can only be connected to the shared directories ... | Samba shares - Cannot access with users |
1,281,554,099,000 |
I have installed ftp and sftp on my linux mint system, for wordpress file transfer
I had to create new user account for ftp and sftp on my system during the installation process.
Is it possible to run ftp and sftp from home user account, if yes, how to configure it.
And if single user account access is possible- what ... |
The SFTP article you quoted is misleading at best, and inaccurate for the remainder. SFTP has nothing to do with vsftpd.
You can use sftp with your own user account already: sftp you@yourhost
If you have SFTP you almost certainly do not need to install vsftpd. At least, not unless you have a legacy file transfer appli... | can we run ftp or sftp from single user account? |
1,281,554,099,000 |
Im a part of a project group, and one of our tasks is to upload some content to a server. I am completely new to this and have some questions.
There are content on different servers(distributed on several servers). My task is to get all the content, and upload them on a single server, and make them available for other... |
You will need access to the old servers too.
Then you should be able to simply copy the contents using scp or, more efficiently, by creating a gzipped tar file of the content on the old servers, moving everything to the new one with scp and untaring there.
If this is going to be a repeated task, with changing content ... | How to upload to a unix server? |
1,623,772,750,000 |
I just signed up with digital ocean for my Debian server.
In the server I created multiple users, each user having an access to 1 different folder to view files in there.
Now what I want to do is to access that folder from my web browser and login with username and password so that I can start view my txt file.
What i... |
You need to setup a web server, for instance Apache, setting up users areas, and WebDAV services if you want users to write files there.
As an introduction to the theme:how to configure webdav access with apache on ubuntu-14-04
For starters, you can do:
sudo apt install apache2
sudo a2enmod dav
sudo a2enmod dav_fs
Th... | Access Debian server folder via web browser with user login |
1,623,772,750,000 |
Our IT department needs to set up a file server that will hold the organization's documentation and all other important information; it's currently being held on our Windows AD server.
Main objective: To allow all windows users the ability to access that Linux File server using a networked folder as they did before.
W... |
Samba is a good choice for your situation. If you've decided to go with Ubuntu, there's a guide here. This page should set up exactly what you're looking for.
If you're new to Linux, my recommendation is to read that guide for understanding, before attempting any commands. Don't run a command if you're not sure what i... | Ubuntu and Windows environment |
1,623,772,750,000 |
I run a Windows Server 2008 machine. It is used as a file server (File Services feature), in addition to local shares I use CrushFTP for SFTP and HTTP access to my files. I would like to convert to Linux (Ubuntu at first).
What I want is to install the OS on a single HDD (500 GB) and then have a software RAID 1 with t... |
You need to create the RAID1 volume during installation if you want to install to a RAID1 volume. You're finding this in guides because usually, when people are asking about installation and about RAID, it's because they want to install on RAID.
Since you don't want to install on a RAID volume, you have no RAID volume... | Ubuntu Server - OS on single HDD, file server on software RAID 1 |
1,623,772,750,000 |
I am looking for a linux based file server that I can use to store all my files and access remotely through Internet. I have come across a few different alternatives, most promising amahi, but most of these servers prefer the server to manage DHCP, which I can not do as first of all, restarting all the devices on my n... |
If all you need is simple access to your files, I think that setting up a dedicated file server might be overkill. I often need to access files from home when I'm at work or vice versa and I just mount the remote volume locally using sshfs.
I haven't tried this on OSX but according to their page, osxfuse should be abl... | Linux based internet file server |
1,623,772,750,000 |
I have two Macs that I'd like to start backing up using Time Machine, but all of my storage is attached to my Linux file server.
How can I use my Linux file server (which happens to be running Ubuntu Karmic) as a custom Time Capsule replacement, and have my Macs (running 10.6) automatically back up to it using Time Ma... |
There are a few hack-ish options out there, see here, and here.
But I certainly wouldn't do it. This is a hack, it's not supported by apple in anyway and there is no guarantee that the next OS X update won't break it and if it does you're stuck with your backups in a network share that is pretty much useless at that p... | How can I (and should I) use my Linux file server as a Time Machine backup server for my Macs? |
1,623,772,750,000 |
1) I run SSH session on the remote client to get files from the server.
2) There is a server and it keeps a very broad directory structure.
3) I've got a list of thousands path-names to the files on the server. Yet they are only a small fracture of the whole content of the server. So, the files are to be fetched one-... |
Use a combination of mkdir and dirname before you do a sftp
mkdir -p $(dirname /base/q/w/e/r/t/y/file)
dirname will extract the full directory path to the file
mkdir -p will ensure that the entire directory tree is created
(even if it is partially available)
| Get remote files by a list preserving their relative paths, and do it on a remote machine |
1,623,772,750,000 |
I'm very new to the world of active directory, windows server etc., so I apologise if some of the questions I ask are a bit stupid, but I'll try and explain exactly what I want to do below, and my currrent setup.
I'm running Ubuntu Server on a Raspberry Pi, using kerberos and other software detailed in this video to u... |
The windows clients are configured in dns settings to use the ADDC as their preferred dns server (if I change this, then they lose connection to the domain and can't find it...) and use 8.8.8.8 google's dns server as their secondary one
That's an invalid configuration, prone to unexpected errors in the Active Direct... | Active directory server set up DNS resolution failure or VERY SLOW, can I route external DNS requests the traditional way, before the server existed? |
1,623,772,750,000 |
I have a linux system running Debian Wheezy stable on it and am using it as a file repository (not a true file server because I am using BitTorrent sync to move files as I move around the world). Some family has expressed a desire to store data similarly but I would like to give them the space without me necessarily h... |
You pretty much have to trust the administrators of a service with the data you upload to it. Any assertion that a service provider cannot see data provided to it is dubious at best (speaking as a security professional). Even if the provider restricts access or encrypts data, you still have to trust their access res... | Prevent access to files on linux file server |
1,623,772,750,000 |
I have been researching about the security threats to a web server. It makes me want to secure my own on my Raspbian OS system. What are the list of things that are recommended or optional to install or configure on the server.
I currently have:
ClamAV
Fail2ban
Apache httpd
Also, provide me a way that I can configu... |
1 . Upgrade everything
apt update && apt upgrade -y
2 . Secure ssh
grep -P ^Pass /etc/ssh/sshd_config
PasswordAuthentication no
3 . Configure iptables (or ufw, etc) to permit only ssh and https
apt install -y iptables-persistent
iptables --flush
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p icmp --icmp-type... | Securing my Web Server with NAS |
1,512,206,558,000 |
When I log in to an SSH server/host I get asked whether the hash of its public key is correct, like this:
# ssh 1.2.3.4
The authenticity of host '[1.2.3.4]:22 ([[1.2.3.4]:22)' can't be established.
RSA key fingerprint is SHA256:CxIuAEc3SZThY9XobrjJIHN61OTItAU0Emz0v/+15wY.
Are you sure you want to continue connecting (... |
ssh
# ssh -o "FingerprintHash sha256" testhost
The authenticity of host 'testhost (256.257.258.259)' can't be established.
ECDSA key fingerprint is SHA256:pYYzsM9jP1Gwn1K9xXjKL2t0HLrasCxBQdvg/mNkuLg.
# ssh -o "FingerprintHash md5" testhost
The authenticity of host 'testhost (256.257.258.259)' can't be established.
EC... | How to compare different SSH fingerprint (public key hash) formats? |
1,512,206,558,000 |
I want to make efficient use of the fingerprint reader on my laptop. I was able to configure fingerprint reading through fprint and PAM (using the steps described in the second comment here), but I've encountered a small problem.
When logging in with the fingerprint reader the GNOME keyring isn't unlocked. Now I under... |
Well, this is a bit tricky.
The authentication methods for various services are controlled by files in /etc/pam.d/ directory. The pam-auth-update command will update the common-* files, which are @included by the service-specific files.
I'm more of a KDE guy myself, but Cinnamon is a GNOME derivative, so its initial l... | Use fingerprint reader for everything but first login |
1,512,206,558,000 |
I administer a lot of hosts, and every time I ssh into a new batch for the first time, it is tedious to tell my secure shell client yes for each and every host that I accept the host key fingerprint for adding into ~/.ssh/known_hosts. If we accept as a given that I am confident that there are in fact no compromised h... |
ssh-keyscan will check, but not verify, a remote host key fingerprint. Iterate through the host list and append to ~/.ssh/known_hosts:
while read host; do
if entry=$(ssh-keyscan $host 2> /dev/null); then
echo "$entry" >> ~/.ssh/known_hosts
fi
done < hostlist.txt
| How can I automate adding entries to .ssh/known_hosts? |
1,512,206,558,000 |
When I connect to my Dropbear SSH server for the first time, I get the following message:
me@laptop:~$ ssh me@server
The authenticity of host 'server' can't be established.
RSA key fingerprint is SHA256:NycCxoRiiSAGA7Rvlnuf1gU8pazIpXJKZ3ukdivyam8.
Are you sure you want to continue connecting (yes/no)?
To make sure t... |
Locate the host key file on the server:
me@server:~$ ls /etc/dropbear/
authorized_keys config dropbear_rsa_host_key
Use dropbearkey to get the public key portion and fingerprint of that host key:
me@server:~$ sudo dropbearkey -y -f /etc/dropbear/dropbear_rsa_host_key
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAA... | How to verify fingerprint of Dropbear RSA host key? |
1,512,206,558,000 |
When I try any other finger with:
%> fprintd-enroll left-index-finger
Using device /net/reactivated/Fprint/Device/0
failed to claim device: Not Authorized: net.reactivated.fprint.device.setusername
It doesn't work for me;
But if I don't specify finger (which uses right-index by default):
%> fprintd-enroll
Using devi... |
I think this is only supported as of fprintd 0.5.1: http://cgit.freedesktop.org/libfprint/fprintd/commit/?id=7eb1f0fd86a4168cc74c63b549086682bfb00b3e
When I build fprintd 0.5.1, the -f option does work correctly.
| fprintd-enroll works with right-index finger only |
1,512,206,558,000 |
OpenSSH's display format for host key fingerprints has changed recently - between versions 6.7 and 6.8. When connecting to a new host, the message now looks like this:
user@desktop:~$ ssh 10.33.1.114
The authenticity of host '10.33.1.114 (10.33.1.114)' can't be established.
ECDSA key fingerprint is SHA256:9ZTSzJsnk0b... |
Use
ssh -o FingerprintHash=md5 10.33.1.114
to get the old-md5 fingerprint from the client.
| Verify host key fingerprint in old format |
1,512,206,558,000 |
I am using gpg -
$ gpg --version
gpg (GnuPG) 2.2.12
libgcrypt 1.8.4
I am trying to understand the difference between the two commands :
$ gpg --list-key
and:
$ gpg --fingerprint
from whatever little I see, I don't see any difference between two outputs. Am I looking at something wrong ?
|
The --fingerprint option prints the fingerprint into 10 groups of 4 caracters to easily verify the gpg key.
| which part is the fingerprint in gpg public key |
1,512,206,558,000 |
I am trying to make work my finger print sensor thinkpad x390 yoga. I installed printfd package using yay. When I try to run fprintd-enroll, I get this error:
Using device /net/reactivated/Fprint/Device/0
failed to claim device: GDBus.Error:net.reactivated.Fprint.Error.Internal: Open failed with error: The driver enco... |
The solution was to update firmware of fingerprint device. I achieved by:
Installing fwupd
sudo pacman -S fwupd
Check if system can see device:
fwupdmgr get-devices
Refresh firmware database:
fwupdmgr refresh --force
Updating my firmware:
fwupdmgr update
You have to reboot immediatlly to apply update and p... | fprintd: The driver encountered a protocol error with the device |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.