date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,503,005,532,000
i have tor install on my raspberry. *:/home/bitcoin $ cat /etc/group | grep debian-tor debian-tor:x:116:bitcoin,root,pi over can i add a user sudo usermod -a -G debian-tor bitcoin but how can i delete? i wan't root and pi delete.
Use gpasswd instead. gpasswd -d user group It also has option for adding user to group gpasswd -a user group
Delete User in /etc/group
1,503,005,532,000
I run a tor node on debian. Nyx says that my version (0.2.9.16 (git-9ef571339967c1e5)) is obsolete. But when I try to do apt update && apt upgrade, nothing happens, all packages seem up to date. And apt-cache showpkg tor only shows my current version and older ones. What am I doing wrong? Why can't I update tor?
You’re doing nothing wrong. The fact that your system has version 0.2.9.16 tells me that you’re running Debian 9, and Debian 9 only has version 0.2.9.16 of Tor. However, newer versions have been made available in the backports repositories, and you can install version 0.4.1.6 from there: echo deb http://deb.debian.org...
Debian Tor Node - Can't update to newer version
1,503,005,532,000
I've read somewhere that Whonix OS will force all connections through Tor. And I also read about Torsocks who seem to do the same thing. So what's the difference between them? And which one is safer to use?
The way Torsocks works, it's prone to leakage (outbound traffic not through Tor) depending on what the application it's being used on does. Whonix is safer in this regard, as it uses two isolated environments, and the one you run your applications in has no Internet access except through Tor.
Which is safer, Whonix gateway or Torsocks? [closed]
1,503,005,532,000
I want to serve a website through tor, so that I don't have to pay a hosting service or provide my ip to the users. I've followed the steps on Arch Wiki and torproject.org: Step 0: Get a working Tor $ yay -S tor $ sudo systemctl enable --now tor.service Step 1: Get a web server working Previous steps. $ cd ~/code/go/...
HiddenServicePort 9998 127.0.0.1:9998 means that, in order to access it, you will need to browse to <hostname>:9998 in the Tor Browser. If you just want the default HTTP port, you can use HiddenServicePort 80 127.0.0.1:9998 and you could add HTTPS with HiddenServicePort 443 127.0.0.1:9998.
How to set up onion service?
1,503,005,532,000
i would like to change default tor port from 9050 to 9150. Editing /etc/tor/torsocks5.conf i can see these: TorPort 9050 so, changing to 9150, it should work, right? it doesnt. > sudo vi /etc/tor/torsocks.conf > sudo cat /etc/tor/torsocks.conf | grep 9150 TorPort 9150 > sudo service tor reload > sudo service tor r...
The parameter you want to change is: SocksPort 0.0.0.0:9150 Usually this is located in torrc file.
How to change Tor port in Kali
1,503,005,532,000
Could anyone help me with a review of my iptables rules (running a new Tor relay server), please? I'm running a Debian GNU/Linux 11 (bullseye), fully updated. I drop everything in INPUT chain by default, SSH port is censored, so if you see XXYYZ... I changed it to a custom port so that the bots have a little bit more ...
For your reference: *filter -N RNNS -A RNNS -p tcp ! --syn -j REJECT --reject-with tcp-reset # accept (new) syn -A RNNS -j ACCEPT -N ALLOW # tcp (r)eset (n)ew but (n)ot (s)yn # -j RNNS is fine too since the chain has a "fallback" verdict at the end -A ALLOW -p tcp --dport 9001 -g RNNS -A ALLOW -p tcp --dport 9030 -g ...
Review iptables on a VPS (running Tor non-exit relay)
1,503,005,532,000
I am thinking of trying the thunderbird add-on torbirdy The problem is, it only works up to Thunderbird version 60.2.1 from October 2018. I am running Debian Buster which updates Thunderbird automatically and it's currently on 68.11.0 Is it worth somehow rolling back thunderbird to that version, and telling Debian to ...
I'd do the following: uninstall the version offered by Debian, install the version offered by Mozilla itself, e.g. https://ftp.mozilla.org/pub/thunderbird/releases/60.2.1/ - just unpack a tar.gz to a directory of your choice. It's advisable to use the latest stable release, e.g. 60.9.1 which should retain the same lev...
peg thunderbird to older version or install a second instance
1,503,005,532,000
I'm in the process of installing a (somewhat modified) Fedora Core 24 system, and am still trying to do things in the mostly right way. How can I get dnf install vidalia (which, in quotes, has only Spanish results in google) to work? I've seen RPM files for vidalia, but I'd prefer to add a new repo (like pkgs.org?) in...
I'm afraid vidalia appears to be retired: https://admin.fedoraproject.org/pkgdb/package/rpms/vidalia/ Probably, there isn't any repository available for F24 that contains it. If there is you have to find it first, there is no magic command for that part. (By the way, the name was changed from Fedora Core to just Fed...
"dnf install vidalia" on Fedora Core 24?
1,503,005,532,000
I am trying to install TOR on Kali Linux 2016.2 but I am getting the following error message. apt-get install tor Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libssl1.0.0 tor-geoipdb torsocks Suggested package...
deb [arch=i386,amd64,armel,armhf] http://http.kali.org/kali kali-dev main contrib non-free deb [arch=i386,amd64,armel,armhf] http://http.kali.org/kali kali-dev main/debian-installer deb-src http://http.kali.org/kali kali-dev main contrib non-free deb [arch=i386,amd64,armel,armhf] http://http.kali.org/kali kali main c...
Errors in installing Tor on Kali 2016.2 VM
1,503,005,532,000
Suppose command1 takes another command (say command2) as argument, with command2's arguments as the remaining arguments of comman1, i.e. command1 command2 arg... When command2 is a made up of several commands (each of which might have its own arguments and options), e.g. when command2 is command 3; command 4 and com...
[The following links may not be the actual version you have, but are probably similar enough]. The torify command is a shell script, which just calls torsocks which is another shell script that just does exec. So you should just be able to provide multiple commands to torify like this: torify sh -c 'curl ifconfig.me;...
How to specify a compound command as an argument to another command?
1,389,544,625,000
Is there a benefit of creating a file with touch prior to edit.. like: touch foo vi foo versus getting it to editor straight-away? Like: vi foo I see quite a few tutorials using the former (touch then vi).
touching the file first confirms that you actually have the ability to create the file, rather than wasting time in an editor only to find out that the filesystem is read-only or some other problem.
Use of touch and vi?
1,389,544,625,000
I am getting the error: touch: cannot touch `/opt/tsrm/compliance/cme/log/20121207.log`: No such file or directory on the touch command: touch $LOGFILE I also checked the link: touch: cannot touch `foo': No such file or directory, But I didn't understand the answer. Note: I was also getting mkdir: cannot create di...
You do not have the path that holds the file: /opt/tsrm/compliance/cme/log/ That's where the error come from.
touch: cannot touch file: No such file or directory [duplicate]
1,389,544,625,000
Never realized that you could do this until just now: : >> file It seems to be functionally similar to: touch file Is there a reason why most resources seem to prefer touch over this shell builtin?
You don't even need to use :; you can just > file (at least in bash; other shells may behave differently). In practical terms, there is no real difference here (though the minuscule overhead of calling out to /bin/touch is a thing). touch, however, can also be used to modify the timestamps on a file that already exi...
When creating an empty file, why might one prefer 'touch file' over ': >> file'?
1,389,544,625,000
What could cause touch to fail with this error message? touch: cannot touch `foo': No such file or directory Note that an error due to incorrect permissions looks different: touch: cannot touch `foo': Permission denied
Following sequence causes this error message: $ mkdir foo $ cd foo In another terminal: $ rm -r foo In the previous terminal: $ touch x touch: cannot touch `x': No such file or directory Of course, other events that also result in invalidating the current working directory (CWD) of a process that tries to create a ...
touch: cannot touch `foo': No such file or directory
1,389,544,625,000
It seems that whenever I create a file with touch the permissions are set to: -rw-r--r--. Is there some way that I can configure the permissions with touch or does this have to be done after with a different command?
You can modify your umask to allow (for most implementations) more read/write privileges, but not executable, since generally the requested permissions are 0666. If your umask is 022, you'll see touch make a 0644 file. Interestingly, POSIX describes this behavior in terms of creat: If file does not exist: The creat(...
How to set file permissions with touch command
1,389,544,625,000
From man touch: -f (ignored) But I don't get what is meant by ignored. I've tried following: $ ls -l file -rw-rw-r-- 1 pandya pandya 0 Mar 20 16:17 file $ touch -f file $ ls -l file -rw-rw-r-- 1 pandya pandya 0 Mar 20 16:18 file And noticed that it changes timestamps in spite of -f. So, I want to know what -f...
For GNU utilities, the full documentation is in the info page, where you can read: -f Ignored; for compatibility with BSD versions of `touch'. See historic BSD man pages for touch, where -f was to force the touch. If you look at the source of those old BSDs, there was no utimes() system call, so touch would open ...
What is the use of the -f option for `touch`?
1,389,544,625,000
I was wondering if anyone knows how to change the timestamps of folders recursively based on the latest timestamp found of the files in that folder. So for example: jon@UbuntuPanther:/media/media/MP3s/Foo Fighters/(1997-05-20) The Colour and The Shape$ ls -alF total 55220 drwxr-xr-x 2 jon jon 4096 2010-08-30 12:3...
You can use touch -r to use another file's timestamp instead of the current time (or touch --reference=FILE) Here are two solutions. In each solution, the first command changes the modification time of the directory to that of the newest file immediately under it, and the second command looks at the whole directory tr...
How do I change folder timestamps recursively to the newest file?
1,389,544,625,000
I am trying to update the timestamps of all folders in the cwd using this: for file in `ls`; do touch $file; done But it doesn't seem to work. Any ideas why?
All the answers so far (as well as your example in the question) assume that you want to touch everything in the directory, even though you said "touch all folders". If it turns out the directory contains files and folders and you only want to update the folders, you can use find: $ find . -maxdepth 1 -mindepth 1 -typ...
touch all folders in a directory
1,389,544,625,000
I know how to get a file's mtime in epoch format: stat --format=%Y <file> But I have not been able to figure out how to set a file's mtime in epoch format. The touch(1) man page appears to only accept a "timestamp" value (more-or-less fixed format which uses months, days, hours, minues, etc) or a "mostly free format ...
At least in the GNU world: touch --date=@1403970787 file Like with date.
How do I set a file's mtime in epoch format?
1,389,544,625,000
My question is not so much a question of computer science as it is a question of etymology. The command touch changes file access and modification times. What does 'touch' stand for?
It doesn't stand for anything; it's not an abbreviation or initialism. It's a verb. When you touch a file, you're "putting fresh fingerprints on it", updating its last-modified date (or creating it if it did not yet exist).
What does 'touch' stand for?
1,389,544,625,000
I am trying to create a file in a directory but I am getting: `touch`: cannot touch ‘test’: Permission denied Here are my commands: [user@xxx api]$ ls -l total 184 ... drwxrwxr-x 2 root root 4096 2016-04-12 14:38 public .. [user@xxx api]$ cd ./public [user@xxx public]$ touch test touch: cannot touch ‘test’: Permi...
You can't edit the contents of the public directory if you don't have write and execute access. You indicate you are attempting to create a new file. If the test file doesn't already exist in public, touch will attempt to create a new file. It cannot do this without the write and execute permissions over the parent d...
touch: cannot touch ‘test’: Permission denied
1,389,544,625,000
Watching a video (https://vimeo.com/56166857 & https://www.youtube.com/watch?v=9CTfGS0gEOk @ 1m:34s), the presenter (TJ Holowaychuk) wrote: touch !!:2{...} I can't find what !!:2 means anywhere. I get the (repeat the previous command) !! but, the meaning of !!:2 I don't know, can't find an answer for and the search...
You've misread what the presenter entered. This is what is actually given on the video: mkdir -p lib/{login,signup,users,posts} touch !!:2/{package.json,index.json} This extends the !! instruction to repeat the previous command, but the :2 modifier says use the second argument. So, here !!:2 is the lib/{login,signup,...
What does !!: mean in bash? [duplicate]
1,389,544,625,000
I have been testing find directory which is taking max inodes and while testing I had run touch test_{1..1391803}.txt But it's give me error "-bash: /usr/bin/touch: Argument list too long", now I'm running below command, but it's seems it will take Hugh time ruby -e '1.upto(1391803) { |n| %x( touch "test_#{n}.txt" ...
The limitation is on the size of the arguments upon execution of a command. So the options are to execute a command with fewer arguments, for instance with xargs to run smaller batches, increase the limit (ulimit -s 100000 on Linux), not execute anything (do it all in the shell), or build the list in the tool that cre...
Efficient way to create multiple files
1,389,544,625,000
How do I use GNU touch to update a file called -? How do I use GNU cat to display a file called -? I'm running: % cat --version | head -n1 cat (GNU coreutils) 8.29 % touch --version | head -n1 touch (GNU coreutils) 8.29 Firstly, touch: % touch - % ls -l total 0 % touch -- - % ls -l -- - ls: cannot access '-': No su...
Use an explicit path to the file: touch ./- cat ./- GNU touch treats a file operand of - specially: A FILE argument string of - is handled specially and causes touch to change the times of the file associated with standard output. For cat, the POSIX standard specifies that a file operand - should be interp...
How to `touch` and `cat` file named `-` [duplicate]
1,389,544,625,000
We have a file foobar not owned by me, but it is in my group: $ ll total 4,0K -rw-rw-r-- 1 root hbogert 4 jan 19 12:27 foobar I can touch it and it will update all times: $ stat foobar File: 'foobar' Size: 4 Blocks: 8 IO Block: 4096 regular file Device: 801h/2049d Inode: 4869333 Links: ...
The behaviour is expected, if rather non-obvious. At least on my system, touch does utimensat(0, NULL, NULL, 0) in the first case (touch file), and utimensat(0, NULL, [UTIME_OMIT, UTIME_NOW], 0) in the second (touch -m file). The first call is short-hand for "set the access and modification times to the current time...
Why can touch change only all times, or nothing when not owner
1,389,544,625,000
In a shell, how to automatically set the modification (or creation) date and time of a Quicktime video file based on the metadata in the file with a single command (or a single command line)? For JPG files, we have exiv2 -T, but is there a similar command for .mov files? To give an example, let's start with a file vi...
exiftool can set most of files metadata in addition to retrieving it, so it should just be a matter of: TZ=UTC0 exiftool '-FileModifyDate<MediaModifyDate' ./*.mov Or: exiftool -api QuickTimeUTC '-FileModifyDate<MediaModifyDate' ./*.mov Or recursively (also updating files in subdirectories): exiftool -api QuickTimeUT...
How to automatically set the modification (or creation) time of a Quicktime video file based on its meta data?
1,389,544,625,000
Is it possible to change a file "Birth date" (according to the stat file "Birth" field)? I can change the modification/access time with touch -t 200109110846 file, but can't find the corresponding option for "Birth".
Like the last change time, the birth time isn’t externally controllable. On file systems which support it, the birth timestamp is set when a file is created, and never changes after that. If you want to control it, you need to change the system’s notion of the current date and time, and create a new file.
Change file "Birth date" for ext4 files?
1,389,544,625,000
I am trying to create 50 directories (dir-01..dir-50). And I want to create 50 files (01.txt..50.txt) inside each of the 50 directories. For example: dir-01/01.txt..50.txt dir-02/02.txt..50.txt etc... I am able to create the the directories, but I am having trouble with creating the files inside each. I a...
With zsh or bash or yash -o braceexpand: $ mkdir dir-{01..50} $ touch dir-{01..50}/file{01..50}.txt $ ls dir-45 file01.txt file09.txt file17.txt file25.txt file33.txt file41.txt file49.txt file02.txt file10.txt file18.txt file26.txt file34.txt file42.txt file50.txt file03.txt file11.txt file19.txt file27.txt file35.tx...
Creating 50 directories with 50 files inside
1,389,544,625,000
I need to create 26 files named a to z in single command. I thought touch command would be sufficient with the regex, but it doesn't expand [a-z] instead it creates a single file with name "[a-z]". $ touch [a-z] Any way to achieve these? Note: $ bash -version GNU bash, version 4.3.30(1)-release (i686-pc-linux-gnu)...
In bash (version 3.0 (2004) and above), ksh (since ksh93r (2006)) and zsh (version 5.0.6 (2014) and above): touch {a..z} (note that only zsh supports characters other than ASCII letters and digits, none goes as far as perl's .. operator which inspired those shells operators). With other zsh version (since 2.2 (1992))...
How to create files named 'a to z' - any trick? [duplicate]
1,389,544,625,000
I am trying to mirror the directory and file structure of a particular directory. However, I want the mirrored files to have no size. So for example, if I had the following directory tree: original_folder ├── images │ ├── image1.jpg (2 MB) │ ├── image2.jpg (3 MB) ├── videos │ ├── video1.mp4 ...
GNU cp (from coreutils) can do this: cp -r --attributes-only original_folder/* mirrored_folder/ From man cp: --attributes-only don't copy the file data, just the attributes -R, -r, --recursive copy directories recursively Using find command as OP says xe is on MacOS and cp command has no --attributes-only option:...
How to mirror directory structure and files with zero size?
1,389,544,625,000
I want create empty files with the same name, but in another location. Is it possible? find some files use only filenames touch an empty file in another place Something like this: find . -type f -name '*.jpg' -exec basename {}.tmp | touch ../emptys/{} \;
you can use the --attributes-only switch of cp for this purpose, eg. find . -iname "*.txt" -exec cp --attributes-only -t dummy/ {} + From the man page of cp: --attributes-only don't copy the file data, just the attributes This will create empty files with all attributes of the original file preserved but no content...
Find and create empty files with the same name in another location
1,389,544,625,000
I have many big folders with thousands of files in them and I want to use touchto set their modification times to be "original time"+3 hours. I got this script from a similar thread in superuser: #!/bin/sh for i in all/*; do touch -r "$i" -d '+3 hour' "$i" done so I'm guessing what I need is to make it work in any ...
Use find -exec for recursive touch, with command line args for dirs to process. #!/bin/sh for i in "$@"; do find "$i" -type f -exec touch -r {} -d '+3 hour' {} \; done You can run it like this: ./script.sh /path/to/dir1 /path/to/dir2
Script for changing modification time of files and directories recursively
1,389,544,625,000
Edit: Better worded question: How do I only use the touch command to set the modification time of a file to the unix epoch? I know that the unix epoch value can be retrieved using "data %s", but how do I use the touch command (and only that command) to set the modification time to the unix epoch? Edit2: So, I found t...
-t doesn't accept epoch time, -d does -d, --date=STRING parse STRING and use it instead of current time -t STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time You need to use -d or --date instead of -t and you need to put @ before epochtime format is used, as described in date manpages:...
Use touch command to set modification time of a file to the Unix epoch
1,389,544,625,000
I want to change the created timestamp of many images one week ago. Code % http://askubuntu.com/a/62496/25388 touch -d "7 days ago" *.png Output touch: invalid date format ‘1 one ago’ OS: Debian 8.5
You need to use - foo format: $ ls -l file -rw-r--r-- 1 terdon terdon 0 Nov 29 11:05 file $ touch -d '-1 week' file $ ls -l file -rw-r--r-- 1 terdon terdon 0 Nov 22 11:06 file
How to change created time stamp one week ago?
1,389,544,625,000
This sounds like an easily researched question. It isn't. I'm following the following highly recommended post on an Ubuntu Stack Exchange site that I happened to run across. But the suggestion doesn't work on Red Hat Enterprise Linux ES release 4. I would have expected it to, but it fails, as detailed below. This ...
Updated Answer I stumbled across this gem touch -r filename -d '+8 days' filename From the info coreutils touch invocation (Thank you @don_crissti ): '-r FILE' '--reference=FILE' Use the times of the reference FILE instead of the current time. If this option is combined with the '--date=TIME' ('-d TIME') option, ...
How to use touch to set modified/created timestamp of a file?
1,389,544,625,000
Machine A's file system is mounted on machine B via sshfs. A process running on B, which was initiated from A by ssh touches a file on the mounted file system of A to communicate a signal; the signal (file) is then removed by A. This works reliably the first time the file is created/destroyed (touch/rm). However, if a...
You can investigate what might be happening by running sshfs with option -o debug. It prints a lot of information on the basic filesystem operations done by a touch test command. An example operation is: unique: 209, opcode: LOOKUP (1), nodeid: 1, insize: 45, pid: 10641 LOOKUP /test getattr /test NODEID: 44 uni...
re-touching files over sshfs
1,389,544,625,000
Suppose I have a directory /, and it contains many directories /mydir, /hisdir, /herdir, and each of those need to have a similar structure. For each directory in /, there needs to be a directory doc and within it a file doc1.txt. One might naively assume they could execute mkdir */doc touch */doc/doc1.txt but they w...
With zsh: dirs=(*(/)) mkdir -- $^dirs/doc touch -- $^dirs/doc/doc1.txt (/) is a globbing qualifier, / means to select only directories. $^array (reminiscent of rc's ^ operator) is to turn on a brace-like type of expansion on the array, so $^array/doc is like {elt1,elt2,elt3}/doc (where elt1, elt2, elt3 are the elemen...
Make many subdirectories at once
1,389,544,625,000
I have this variable : toto=123456 why does touch "$toto.hihi.log" works and creates a file called 123456.hihi.log but touch "$totohihi.log" doesn’t do anything ?
You need touch "${toto}hihi.log" The problem is that the shell cannot know without the braces how many characters are part of the variable name. Thus it treats all legal characters as a part of the name. In this case that is everything before the .; i.e. the shell uses the non-existing variable $totohihi. In general ...
creating a file with touch using a variable
1,389,544,625,000
I want to be able to use the touch command with the pipeline to create multiple files depending on the output of a command. Like for example: grep "hello(.*)" file.txt | touch But it doesn't work! How can I achieve this?
The touch command itself cannot read from stdin, but you can do it with the help of xargs: grep "hello(.*)" file.txt | xargs -I file_name touch file_name Edit: It the input for xargs contains a line ending with a backslash (\), a file with a newline in its name would be created. The question does not specify what wou...
Usage of touch with pipeline
1,389,544,625,000
I have created the file which is 30 minutes old by using following command TZ=ZZZ0 touch -t "$(TZ=ZZZ0:30 date +%Y%m%d%H%M.%S)" $HOME/reference Similarly how can I create a file 30 minutes of future time. Ex: at 5:00 PM I want to touch the file to be at 5:30 PM
Simply add a minus sign: TZ=ZZZ0 touch -t "$(TZ=ZZZ-0:30 date +%Y%m%d%H%M.%S)" $HOME/reference Or invert your timezone trick: TZ=ZZZ0:30 touch -t "$(TZ=ZZZ0 date +%Y%m%d%H%M.%S)" $HOME/reference If you need to go beyond the range of timezone offsets, standard shell utilities notoriously lack a way to manipulate date...
Touch the file to future time stamp
1,389,544,625,000
I would like to automate the creation of some files so I created a script. I want also to specify the creation date of those files. In a terminal for example, to create a file.txt with creation date of 12 of May 2012 I could touch as seen bellow, touch -d 20120512 file.txt Listing that file confirms the date, -rw-rw-...
The last part of your script, writing to each file, will result in the files’ last modification times all being updated to the current time. Changing times using touch should be the last thing you do to your files. Note that touch can’t change the creation time (on file systems that track it); see How to change files ...
Can't specify file creation date
1,389,544,625,000
I'm trying to create some files that has different names and with different extensions. Let say I want to create for example 3 files with following name and extension: File001.000 File002.001 File003.002 Or with alphabetical extension: File001.A File002.B File003.C Also it would be better if I could create files wit...
The simplest way I could find is: touch $(paste -d '.' <(printf "%s\n" File{001..005}) \ <(printf "%s\n" {000..004})) This will create File001.000 File002.001 File003.002 File004.003 File005.004 To understand how this works, have a look at what each command prints: $ printf "%s\n" File{001..0...
How to create multiple files/directories with randomized names?
1,389,544,625,000
For the following tree structure: . └── dir1 └── dir2 └── dir3 What would be a simple way to create a file (could be empty), for every directory, so the resulting tree will look like: . ├── dir1 │   ├── dir2 │   │   ├── dir3 │   │   │   └── README │   │   └── README │   └── README └── README
You can do that with find: find . -mindepth 1 -type d -exec touch "{}/README" \; Explanation -mindepth 1 will set the minimum depth, to avoid including the current directory -type d will only find directories -exec will run a command {} contains the path of the found directory If you want to use only builtin shell ...
How to create a file for every directory on a tree?
1,389,544,625,000
This is the output of tree: [xyz@localhost Semester1]$ tree . ├── Eng ├── IT ├── IT_workshop ├── LA ├── OS ├── OS_lab ├── Psy ├── Python └── Python_lab 9 directories, 0 files I want to create 3 common files (named credits, links and notes) in each of these directories using touch. I tried this command: [xyz@localho...
The problem is that globs (the */ is a glob) are expanded by the shell before launching the command. And brace expansions happen before globs. What this means is that */{credits,links,notes} becomes '*/credits' '*/links' '*/notes' and then these globs are expanded by the shell, and because the files haven't been creat...
Why am I not able to use * with touch in path? [duplicate]
1,389,544,625,000
After updating GNOME to 3.20.2 I had some problems with my touchpad so in that confusion I mistakenly deleted /usr/bin/touch and after that I even became more stupid and deleted /bin/touch. Now after this I can't seem to install any of the programs. Here's the error generated in installing a program.. user1@pqrx:~$ s...
I was very thankful for all the valuable time you guys spent answering my question and combining both the answers I found the best solution. IF you have messed up with the coreutils then the best thing to do is download the coreutils file from the repository. As we all know that .deb files are basically archive, open ...
Deleted /usr/bin/touch and /bin/touch. Can't seem to install anything now, nor create any files?
1,389,544,625,000
For now i use this: mkdir -p a/b/c/d/e; touch a/b/c/d/e/file.abc; Is there more efficient ways?
In terms of tools used: no. touch will fail (rightly) if you are trying to operate in a directory that does not exist, and mkdir does precisely one thing: create directories, not normal files. Two different jobs mandate two different tools. That said, if you're talking about efficiency in terms of the number of lines ...
Create file in subdirectories that doesn't exist (../new_folder/new_folder/new_file.ext)
1,484,862,501,000
Suppose my current working directory is: /Users/Directories Under Directories, there are two separate directories called: firstname & last name. I move into the first name directory: $ cd firstname and inside firstname, I want to create an empty file called test1.txt, so I type: $ touch test1.txt This i...
Simply like that : $ touch ../lastname/test2.txt Note that instead of touch, you can use >¹ $ > ../lastname/test2.txt You can also use an absolute path $ > /Users/Directories/lastname/test2.txt Beware that it would truncate files if they existed beforehand while touch would only update their access and last modific...
Without changing your current directory, create an empty file in another directory in Linux?
1,484,862,501,000
On Linux: $ touch 1 12 No problem,create 1 and 12. On SysV or HP-UX 11.31: $ touch 1 12 date: bad conversion I have tried with LANG=C, same error. Why?
According to this hp man page for touch: http://h20565.www2.hp.com/hpsc/doc/public/display?docId=emr_na-c02273390 ... the command expects the following form for touch: touch time_str file_name That form is recognized when neither the -r option, the -t option, nor the -- option delimiter is specified, and the first op...
date: bad conversion error on HP-UX but not on Linux
1,484,862,501,000
I don't want anybody to create a file then change the creation date to backward date(For example using touch or system call). In my Ubuntu hosting account I'm getting many hacked php code getting uploaded. Disallowing them to change the time of file when it landed will help me locate new files easily. What is the way ...
You can prevent hackers from using PHP code to change modification time (mtime) of files that are writeable by your web server by disabling those PHP functions (such as touch) using [disable_functions][1] option in php.ini configuration file. However, tracking modification time is not the right approach because the mo...
How to disallow file modification time change for non root users
1,484,862,501,000
I want to empty current file so I do: touch it, remove it and touch because I do not want to remove non-existing file; example touch "$filenameTarget" rm "$filenameTarget" touch "$filenameTarget" I want to be very careful with deletes. What is the correct philosophy here? OS: Debian...
Simply write nothing to the file: :> "$filenameTarget" This will empty the file if it already exists, and create it (empty) if it doesn't. You need to have the appropriate permissions (the file must be writeable if it already exists, the containing directory must be writeable if the file doesn't already exist).
How to touch, rm and touch in Unix? [duplicate]
1,484,862,501,000
the question is, how can control the ls -l total output ? first impression with example that give us total = 0 els3@els3PC:~/test$ touch file els3@els3PC:~/test$ ls -l total 0 -rw-r--r-- 1 els3 els3 0 Jul 20 12:05 file As i mention this example give us this result total = 0 by creating empty file. in other way I wil...
From man ls: In addition, for each directory whose contents are displayed, the total number of 512-byte blocks used by the files in the directory is displayed on a line by itself, immediately before the information for the files in the directory. The minimum number of blocks allocated to a file depends on OS, file...
How Can i control the 'total' output in 'ls -l' command? [duplicate]
1,484,862,501,000
I have about 100 .jpeg images that I would like to change the file time stamp for. I have seen many examples of using touch to modify the time stamp based on the number of days, hours, etc., but those do not work in my situation. I have attempted to use touch -d "-1969 days ago" on one of the files, but the new time w...
You could use a combination of date and touch, here GNU coreutils. If I read you correctly you want a specific date and keep file time, as in HMS. Not set each file say 300 days prior to the current value. You can create that time by combining the string 2014-05-25 with the extracted time from the files by using date,...
Change time stamp to specific date keeping existing time
1,484,862,501,000
On macOS I am running a shell script that uses touch to create an empty file without an extension. The files created using the same script randomly have different Kinds, i.e. "Document", "Unix executable", "TextEdit.app Document" with no apparent differences between them. No extended attributes /usr/bin/touch /Volumes...
Great question. Unfortunately, there doesn't seem to be a documented answer. The file kind is said to be a "tag", and seems to be a metadata element related to the kMDItemKind field. Its primary purpose seems to be for classifying search results from Spotlight. But perhaps the most relevant answer to your question is ...
Why does using touch, to create an empty file with no filetype, create various kinds of files?
1,484,862,501,000
I am curious whether it is possible to create a directory and file inside this directory with one command, similar to mkdir -p but for a text file and intermediate directory. I read through the touch manual and found nothing. Neither I could find the answer on unix stackexchange. Is there any way to do so (perhaps wit...
There's the install command from GNU coreutils with the -D option which can copy a file and create the directories leading to them in one go (and also let you specify the ownership and permissions). By default, it creates executable files and doesn't honour the umask as it's typically used as a dev tool in make instal...
Zsh: How to create a directory and file inside it with one command?
1,484,862,501,000
on my Linux box I have 2 DELL touch display of the exact same type. One is connected on HDMI-2, the other on DP-1. To map the touch display I use sudo xinput --map-to-output _ID1_ HDMI-2 sudo xinput --map-to-output _ID2_ DP-2 problem is every time I disconnect and reconnect the USB of touch device the ID changes...t...
If you always use the same usb socket for a touchscreen, you might be able to convert the id used by xinput for a device to the fixed "path" of the device on the usb bus. Use xinput list to find the 2 ids of the touchscreens by name. Then use xinput list-props on each id and look for the Device Node, eg: $ xinput list...
Map touch display of the same type with xinput - which is which
1,484,862,501,000
I am pretty sure it is a stupid mistake but I can't seem to figure it out by myself, so please have a look. I set up an ACL for the current folder like so: zigbee2mqtt@nuc:/tmp/folder$ getfacl . # file: . # owner: zigbee2mqtt # group: zigbee2mqtt user::rwx user:stack:r-x user:zigbee2mqtt:rwx user:milkpirate:rwx group:...
What you see in the ls listing are the "traditional" permission bits, all you'd have in a system that doesn't support ACLs, and all that can be used by tools (or users!) that aren't ACL-aware. The "traditional" group permission bits don't correspond to the owning group ACL, but to the ACL mask (acl(5) man page): CORR...
touch/mkdir seems to ignore default ACL
1,484,862,501,000
I want to touch each file in a directory: files=$(ls -a "node_modules/suman-types/dts") echo "files $files"; for file in "$files"; do echo "touching file $file"; touch "node_modules/suman-types/dts/$file"; done but after running that, I get: inject.d.ts injection.d.ts integrant-value-container.d.ts it.d.ts ...
Your problem stems from capturing all of the ls output into a single (string) variable named files. The variable looks something like: filename1\nfilename2\nfilename3\n... See for yourself with: echo "$files" | od -c What you're really doing is looping once over a really long string that corresponds to a file that d...
I get message "File name too long" when running for..in and touch
1,484,862,501,000
I am trying to create a series of files with brace expansions. I want create the files fileA1 to fileZ100 with all possible combinations (Something like touch file[A..Z][1..100]). If I run the command touch $(printf "file%d " {1..100}) the output is ok: file1 file15 file21 file28 file34 file40 file47 file53 ...
So, here: printf "file%c%d " {A..Z}{1..100} The brace expansion produces strings like A1, A2, A3... Z99, Z100. Then printf tries to match those to the format specifiers %c and %d, using the first for %c, second for %d, third for %c again, etc. But %d expects a number and A2 isn't one, so there's an error. %c%d would ...
Create multiples files with brace expansion combining letters and numbers
1,484,862,501,000
For example, in rm -r abc* "*" means any string. However, if we use it in touch abc* abcd* abcde* (and we don't have any files in directory starting with abc or abcd or abcde) "*" means just a symbol, and files abc* abcd* abcde* will be created. If after that we will use touch -m ab* the modification time of files abc...
When a pattern such as abc* is used unquoted in the shell, the shell will try to match it against the available filenames (this is called "filename generation" but is often referred to as "globbing"). If it fails to match any filename, most sh-like shells will leave the pattern unexpanded and pass it to the utility a...
Why "*" works differently in different commands?
1,484,862,501,000
Testing with the linux command line and pipe I tried to do echo {1..3} | touch and it doesn't work. I achieved the results with touch $(echo {1..3}). Why I can't pass the list generated by echo to touch using the pipe as in the first example?
Thanks to steeldriver for his comment, it guided me to the answer. The pipe operator only works when the command accepts arguments from stdin, in this case commands like touch or rm does not, an alternative solution is to use command sustitution as in the example touch $(echo {1..3}) Or by using the xargs which conve...
Pipe vs Command substitution [duplicate]
1,484,862,501,000
I have a lot of files where filename contains file creation date (IMG_YYYYMMDD_hhmmss.jpg): IMG_20171015_133516.jpg IMG_20171015_133827.jpg IMG_20171015_142634.jpg IMG_20171015_142834.jpg IMG_20171015_142857.jpg but actual file creation date is different. I need to set it back to date from a filename. I know how to c...
In the shell: for f in ./IMG_*.jpg ; do t=${f##*/} touch "$f" -t "${t:4:8}${t:13:4}.${t:17:2}" done Bash, ksh, zsh etc have the ${var:n:m} substring expansion, and if you need to do it recursively, enable globstar and use **/IMG_*.jpg instead. Doing it with find needs the shell, too: $ find -name "IMG_*.jpg...
Set file modification date from date stored as filename
1,484,862,501,000
I have written a shell script to touch all the files in the /tmp directory. However, there was an error message saying that /bin/touch: Argument list too long. What's the cause of the problem? #!/bin/bash dayNo=1 while test $dayNo -le 200 do touch `find /tmp/` sleep 86000 done
You have so many files in /tmp that you can't fit all the names on the command line at once (the version you have is also unsafe if any paths have whitespace in them). The good news is that find can do this for you safely and correctly: find /tmp -exec touch -c '{}' + will find all the files as before, and then run t...
shell script for auto-touching files
1,484,862,501,000
I have created a script to read 15 pcap files from a folder and merge then into one file using mergecap command. I want the merged file to have the creation time same as the first file of the 15 files and the last modified time same as the last 15th file. W.R.T Changing a file's "Date Created" and "Last Modified" attr...
The simplest : you could use : touch -r Referencefile THEFILE to give THEFILE the same time as Referencefile so: rm -f Referencefile echo > Referencefile #to set the creation time #...do your captures here, then concatenate into THEFILE .... echo >> Referencefile #to set the modification time touch -r Referencefi...
Updating last modified time of a file
1,484,862,501,000
My system is Kernel: 5.3.0-26-generic x86_64 bits: 64 Desktop: Cinnamon 4.4.8 Distro: Linux Mint 19.3 Tricia Touch version is touch (GNU coreutils) 8.28 When the following command is given - $ touch #a{1..10} It says - touch: missing file operand Try 'touch --help' for more information. What is the issue here?
(Using set -x (xtrace) to see the command that actually runs) $ set -x $ touch #a{1..10} + touch touch: missing file operand Try 'touch --help' for more information. $ touch a{1..10} + touch a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 The hash sign # at the start of a word makes the rest of the line a comment. You need to quote i...
touch: missing file operand with filename containing hash #
1,484,862,501,000
I'm trying to create a script that can: look for a file containing "foobar" as name a script is executed on this file and the output must be stored in a new CSV file, which is created automatically and which has the same name as the searched file. The only difference is that the extension is changed to CSV. This is...
try for file in *"$foobar"* do dest="$(echo $file| sed -e 's/\(.*\)\.[^\.]*$/\1.csv/' )" if test -f "$file" then /home/user/scriptModelise.pl "$file" >> /home/user/Documents/collectCSV/$dest else echo "no $foobar file" fi done where \(.*\)\.[^\.]*$ capture a pattern with any char, (end ...
how to create a file automatically?
1,484,862,501,000
I have a bunch of files in a directory where the modification time was changed (incorrectly) with touch -m The access time of these files is still close enough to what the modification time was, so I'd like to change them back. Is there a way of doing a touch where it sets the mtime = atime? I don't want to set them ...
How about: #!/bin/bash for file in *; do # Get the access time using stat dateString=$(stat --format %x "$file") # Use the datestring to update the time with the # access time touch -d "$dateString" "$file" done From man stat: %x time of last access, human-readable
Changing file modification time to access time in bulk
1,484,862,501,000
I'm using Amazon Linux with bash shell. I'm trying to touch every file in a certain directory, but this command is failing: [myuser@mymachine scripts]$ find /usr/java/jboss/standalone/deployments/myapp.war -type f -exec touch '{}' ; find: missing argument to `-exec' How do I correct the above?
-exec touch {} \; or better yet the modern xargs-style -exec touch {} + as ; otherwise is used by the shell for conflicting purposes.
How do I touch every file in a directory? [duplicate]
1,484,862,501,000
I'm on macOS Ventura 13.2. Tried to fix python by adding it to .zshrc: echo "alias python=/usr/bin/python3" >> ~/.zshrc zsh: no such file or directory: /Users/username/.zshrc Seems like the file is gone, so I attempted to recreate it: touch ~/.zshrc touch: /Users/username/.zshrc: No such file or directory No luck. W...
Your file ~/.zshrc is a symbolic link to a name in a directory that does not exist. This means appending to the file will fail in the way you show, and touching the file will also fail similarly. To resolve this, you may either try to recreate the correct symbolic link or remove the broken one and replace it with an ...
touch: /Users/username/.zshrc: No such file or directory
1,484,862,501,000
I need to create a script to scan folders in a directory and take the name of each folder, make a .txt file, name it with the name of the folder and put inside that folder. For example: A directory that has 3 folders in it named "1" "2" and "3" I want to create a .txt file in each folder named with the name of that fo...
Assuming you just want the immediately directories and not all nested sub directories. The following assumes you are currently in the same directories and the directories you want to loop over for dir in *; do [ -d "$dir" ] && touch -- "$dir/$dir.txt" done This will loop over every file in the current directory...
How to make a for loop to read directory names with spaces in them?
1,484,862,501,000
I would like to create files from the following list. There is no problem if the list doesn't have a space ... but the problem is it has a space user@linux:~$ cat file.txt Apples Bing Cherry Crab Apples Dragon Fruit user@linux:~$ Before ser@pc:~$ ls -l total 4 -rw-r--r-- 1 user user 44 Jun 9 14:06 file.txt user@...
With the GNU implementation of xargs, you can specify newline as the separator with the -d/--delimiter option: xargs --no-run-if-empty --delimiter='\n' --arg-file=file.txt touch -- With short options: xargs -r -d '\n' -a file.txt touch --
How to create files from a list which contain space [duplicate]
1,484,862,501,000
I have searched for a similar question here, but found nothing related. In Linux, the dot (.) refers to the directory itself. The touch command creates a file, if it does not exist. But what does touch . (dot as argument) do? I have checked the GNU touch documentation and the LINFO information about dot, but found not...
From the GNU touch documentation: touch changes the access and/or modification timestamps of the specified files. So, if the file exists, then touch modifies it's timestamps. We can check this: $ stat . File: '.' Size: 40 Blocks: 0 IO Block: 4096 directory Device: 11h/17d Inode: 2338759 L...
In Linux, what does "touch ." (touch dot) do?
1,484,862,501,000
I have set up a very simple script so that I can test whether a process is running or not and if so then it will touch a file and everything will be fine. However if process is not running and file isn't touched then I want to be able to set up an alert. pgrep "sleep" >/dev/null && touch monitor.log This script is ru...
This is a straightforward file modification time check; the complications mainly arise from the possibility of up to 86,400 alerts per day (usually over a long holiday weekend is when these sorts of thing break), and additional complications of whether or not the modification time checker (or cron, or the system...) a...
Creating alert notification if process stops touching file
1,484,862,501,000
I need to do it for over 600 folders with varying names and the .nfo file inside doesn't necessarily have the same name as the folder, he is just a few of them. m0j0@unity ~/files/TV.TL/TEST $ ls -lr total 28 drwxrwx--- 2 m0j0 m0j0 162 Nov 30 19:57 G.S01E07.720p.AMZN.WEB-DL drwxrwx--- 2 m0j0 m0j0 164 Nov 30 19:57 G....
I was able to do it with the following command: for i in *;do touch -r "$i/"*.nfo
How to change folder's creation date to match the creation date of the .nfo file inside?
1,484,862,501,000
I have a list of files that are space separated and I want to use the touch command to update their timestamps in that order. But when I supply the filenames as arguments, the timestamps get updated in a different order. touch 1.txt 2.txt 3.txt 4.txt 5.txt 6.txt 7.txt 8.txt 9.txt 10.txt 11.txt 12.txt After running t...
With no time specified, touch changes the timestamps of all its arguments to the current time at the time each file is touched, which should produce a different timestamp for each file, but in many cases this ends up applying the same timestamp to all its arguments; you can verify this by running stat on all the touch...
Execution order of touch command arguments
1,484,862,501,000
I have tried this but it is not working touch dir_practice ../cambridge/library/ touch dir_practice ./sample_dir/cambridge/library/****
If you look at the man page for touch, you'll see that it takes a filename as an argument. So what you need is: touch ../cambridge/library/dir_practice Since you're new to this, let's break this down. A relative pathname is a path specified relative to your current location. Contrast this with an absolute pathname, w...
Issue creating a regular file for a directory
1,570,710,319,000
I'm trying to set up a system that joins an untagged Ethernet network to a TAP tunnel, adding a VLAN tag as the traffic moves to the tunnel. So far I have: eth0 - the physical Ethernet interface carrying untagged traffic. tap1 - the TAP tunnel interface. br0 - a bridge that contains tap1 (and some other physical inte...
Yes: you can set the bridge to be VLAN aware. The bridge will then handle VLAN IDs attached to frames crossing it, including tagging and untagging them according to configuration, and will send a frame belonging to a given VLAN only to ports configured to accept it. This moves all the settings to the bridge itself rat...
Bridged interfaces and VLAN tags
1,570,710,319,000
There are two server that I can access with 2 different VPN connections. I have managed to have both VPN working on the same time on my machine (a bit of routing rules). I want to do a scp <remote1>:some/file <remote2>:destination/folder from my laptop terminal. But when I try this, the scp command that is invoked on...
Newer versions of scp have the option -3 -3 Copies between two remote hosts are transferred through the local host. Without this option the data is copied directly between the two remote hosts
scp between two servers not in the same network
1,570,710,319,000
The switch configured on the server (Centos 7) is configured as trunk for VLAN#115,2014. I have loaded # lsmod | grep 8021q # modprobe 8021q I would like to configure an IP address on the server using the VLAN#115 Performing the following configuration: ifcfg-em1 TYPE=Ethernet BOOTPROTO=none DEFROUTE=yes PEERDNS=yes...
it seems that disabling NetworkManager did the trick :) systemctl stop NetworkManager systemctl disable NetworkManager
Centos 7: failed to bring up/down networking: configure interface for a trunk interface
1,570,710,319,000
My question: are there any methods to detect that in which vlan I am? Can tcpdump show this? Or can I force a GENERAL switch to say to me?
I am not sure what you mean by a GENERAL switch, but for most switches it is impossible to see in which VLAN you are when you are connected to an 'access' port. That said, using the CDP (Cisco) and LLDP (Juniper) protocols you can find out in which VLAN you are. Enabling CDP/LLDP on an access port is arguably a securi...
In which vlan am I in?
1,570,710,319,000
I have an ethernet port attached to a bridge: $ brctl show bridge name bridge id STP enabled interfaces eth0_bridge 8000.6a612bcc4723 yes eth0 The bridge is VLAN-aware (ie /sys/class/net/eth0_bridge/bridge/vlan_filtering is 1). I want to be able to add other interfaces to that bridge and assign VLANs...
When using the bridge vlan command, you can add (or delete) a range of VLAN IDs in a single shot. For example: # bridge vlan add vid 2-4094 dev eth0 will add all available VLANs to the trunk interface eth0 (0 and 4095 are reserved in the protocol and must not (nor can) be used, 1 is by default set as PVID untagged VL...
Linux VLAN-aware bridges and trunk ports
1,570,710,319,000
Has anyone tried private VLANs under Linux? Any experiences with them? My real question is does anybody have howtos regarding this?
I don't know if Linux supports Cisco's concept of "private VLANs" per se, but what private VLANs essentially are is a link-layer firewall controlling which switch ports can talk to which other switch ports. So if you've got a Linux box with several Ethernet devices and are bridging between them (e.g. with the brctl t...
Private VLAN's under Linux?
1,570,710,319,000
Do you think following configuration make sense? Does BONDTING_OPT supported in VLAN interface? I want to make sure my interface fails over when the upstream device down. ifcfg-bond0 $ cat /etc/sysconfig/network-scripts/ifcfg-bond0 NAME=bond0 DEVICE=bond0 BOOTPROTO=none ONBOOT=yes BONDING_OPTS="mode=1 miimon=500 downd...
You need to configure the devices, then the bond and finally the VLAN config files. You also have to pay attention on what attributes work where, such as the bonding_opts, which can only be in the bond its self, not the VLAN config files as the VLAN files won't be able to access the Ethernet connections directly. I ha...
Linux bond with VLAN question
1,570,710,319,000
I'm working with VLANs on briges and have found that if I add a non-VLAN interface to any bridge, it breaks all the VLAN interfaces - packets leave just fine, but the return packets (which are appropriately VLAN tagged) are getting dropped somewhere. The minute I drop the non-VLAN interface from the bridge, the VLAN i...
In your particular example, br0 is consuming the packets from eth0 and the VLAN code is not getting them. That's probably the right behaviour. If you are adding a trunk port to a bridge, you should run the VLANs off the bridge: brctl addbr br0 brctl addif br0 eth0 ip link set br0 up vconfig add br0 2 brctl addbr br2 ...
Why does adding a non-VLANed interface to a bridge break the VLANed interfaces?
1,570,710,319,000
I have a physical network with a Linux server (Ubuntu 16.04, kernel 4.13) and several gadgets on it. Each gadget has the same unchangeable static IP, e.g. 192.168.0.222/24. I would like to communicate with all these gadgets via an arbitrary IP protocol (e.g. ICMP ping or a custom UDP protocol) Fortunately I have a ma...
I was able to achieve this with the following nftables ruleset (I had to build nft from source as v0.5 which ships with Ubuntu 16.04 doesn't support packet field mangling) : table ip mytable { chain prerouting { type filter hook prerouting priority -300; policy accept; iifname "...
nftables / iptables rules to rewrite source IP by interface
1,570,710,319,000
When configuring an application that creates vlans by using vconfig add, I discovered that it was adding a vlan device to something that was already a vlan device. Effectively, what happened was: # vconfig add bond0 168 ... # vconfig add bond0.168 100 The vlan100 interface was then attached to a bridge which connec...
When you add a VLAN to a device that is already a virtual VLAN interface you get a QinQ interface, this means that packets will eggress with dual VLAN taggs, or VLAN stacking.This is technically possible because a VLAN packet can transport another VLAN packet inside.
What happens if you add a vlan-device to an interface that already is a vlan device?
1,570,710,319,000
I'm using DSA in Linux to support an ethernet switch (KSZ9897). The switch is behaving but I'm having trouble setting up the bridge vlan filtering features through Linux (kernel 4.19). I create the bridge and add the member ports like this: ip link add name br0 type bridge ip link set dev lanB master br0 ip link set d...
I found the command for altering the bridge vlans needs slightly different syntax. 'self' must be appended to the device: bridge vlan add dev br0 self vid 2 pvid Then the command works as expected.
Linux IP bridge and vlan_filtering
1,570,710,319,000
ebtable rule is not allowing me to specify vlanid and ipv4 protocol in one rule. Also I tried this but the second rule is not getting matched for vlan packet. ebtables -t nat -A PREROUTING --vlan-id 100 -j mark --set-mark 100 --mark-target CONTINUE ebtables -t nat -A PREROUTING -i <iface> --mark 100 --ip-dst <ip> -j...
This is a limitation of current bridge filtering with ebtables: ebtables matches are specific rather than generic, and unless one adds a vlan-plus-ip match, it's not possible to match a VLAN tagged IP with ebtables. Here are two methods to work around this limitation, while the first method would allow many things for...
Need to DNAT mac based on vlan and destination IP match.
1,570,710,319,000
I have a problem with VLAN tagging. I am completely newbie about VLAN so maybe there is something I misunderstood at all... Basically: I have a Linux box configured via /etc/network/interfaces as: allow-hotplug eth0 iface eth0 inet static address 192.168.70.31 netmask 255.255.255.0 allow-hotplug eth0.0001 iface...
There is only one physical interface: eth0. Any virtual interface (here: eth0.0001) linked to the actual interface is showing encapsulated traffic in its virtual view until the traffic is emitted through the actual interface. The network stack will make such traffic move through each interface until it reaches the fin...
VLAN tagging: duplicated packets
1,570,710,319,000
I'm using VLAN aware bridge. I have an interface that I need that only packets with VID 10 and 20 could pass through, any other VIDs should be dropped. I configured the interface like that: bridge vlan add vid 10 dev wlan2.2 bridge vlan add vid 20 dev wlan2.2 My problem is that I want to allow untagged traffic to als...
You can configure the port to use a specific Port VLAN ID (pvid) for all received untagged frames and configure this same VLAN ID to be emitted as untagged frames (untagged). While it's possible to emit multiple VLANs as untagged, there's no real use, because the other VLANs that are not the PVID on this port will nev...
How to allow VLAN untagged packet to pass through when using VLAN aware bridge
1,570,710,319,000
I need to install remotely Omxplayer on a Raspberry Pi. RPi is connected by a LTE modem through PPP0 interface. My RPI is placed another country and I connect to Raspberry through my VPN using SSH. My VPN does not have access to Internet and the default gateway is 10.1.64.1 (PPP0). RPI has also WiFi Connection: WLAN0 ...
If I understand correctly you have this arrangement: (Client)---LAN?---(VPN)---ppp0---(Raspberry Pi)---wlan0---(the internet) You mentioned that when you change your default route to use wlan0, you lose SSH access. You also indicated that you can't access the internet through ppp0 (through your VPN). If you just wa...
How can I select the network interface for installing a program in linux?
1,570,710,319,000
Is it possible to bond virtual network interfaces? If yes, how? Bonding of physical interfaces is explained here for example: https://wiki.linuxfoundation.org/networking/bonding My situation is this: I have a host with 10 physical ethernet interfaces (NICs). Each of those is a trunk for multiple VLANs. I plan to make ...
The answer is: Yes it is possible. At least with RedHat, where the bonding of virtual interfaces works the same way as the bonding of physical interfaces. It is even possible to bond (mode=broadcast) virtual interfaces which are configured for different Vlan-IDs. The result is that the packages sent to the bonding int...
Bonding of virtual network interfaces
1,570,710,319,000
On Arch Linux, I have a single physical ethernet interface on 2 VLANs (3 and 7) with static IP addresses for the VLANs and a DHCP address for the 'main' ethernet interface. Is there a way for me to remove the IP address from eth0 and just have the VLANs? Or is there a way to assign eth0 to a VLAN? I'd prefer this to b...
Manually: ifconfig $DEVICE 0.0.0.0 up should remove the IP and leave the interface up and running. Some distributions allow such a configuration statically, others do not. Perhaps you can set up a bridge-device instead.
Remove IP address from interface with VLANs
1,570,710,319,000
My linux home router sits between my ISP (Orange) and my home network. On the WAN side, Orange provide internet in a VLAN tagged 832. Some control messages (ARP, DHCP, ICMPv6 "router discovery" types, DHCPv6) need to be replied to Orange with: - VLAN priority = 6 - IPv4 or IPv6 DSCP = "CS6" (6 bits 0x30, or 48 in deci...
The source issue was a simple sequencing problem regarding the vlan interface. My network interface persistence file was initially misconfigured: # WAN vlan 832 internet auto enp1s0.832 iface enp1s0.832 inet dhcp up ip link set enp1s0.832 type vlan egress 0:0 1:0 2:0 3:0 4:0 5:0 6:6 7:0 iface enp1s0.832 inet6 dhcp ...
Packet meta class applied, but captured VLAN priority is wrong
1,570,710,319,000
I am currently setting up my iot router and ran into some issues regarding connection speed. The router itself is a cascading router. My Internet speed is 100Mbit which I verified by directly connecting to the main router via speed test. However, if I connect it via my cascading router, I only get a connection speed o...
The Banana R1/Lamobo R1 while an interesting piece of hardware has too many shortcomings. Firstly, the "switch" internal interface bandwidth is shared. A theoretical 1GBps tops for all shared 5 ports; the official speed people been able to get from it per interface is around 300Mbit. Second, it has to be setup for th...
Iptables NAT / Kernel IP forwarding limited to ~10Mbit
1,570,710,319,000
This question could arguably be posted on both networking.stackexchange and unix.stackexchange. I'll start here. I have a freeBSD (pfsense 2.1) server running as a router on google fiber. In order to get above 10 Mbps I need to enable egress filtering on the wan port (aka 802.1p, traffic priority, Class of Service, ...
FreeBSD is not like Linux. This is particularly true regarding network configuration: "everything" is in ifconfig. A simple man ifconfig will confirm you that. So to change the value of vlanpcp for you re0_vlan2: ifconfig re0_vlan2 vlanpcp 3 More to read: ifconfig manual vlan mini-HowTo (slightly out-dated)
How do you set a vlan priority on a nic in freeBSD?
1,570,710,319,000
I am trying to implement an obscure workaround to a specific problem tied to a switch misconfiguration I observe in a real case scenario. Please just assume the following : My system is plugged to a trunk link with a cisco switch ; I can send tagged packets in a specific VLAN (not native vlan), it will be properly ro...
Introduction/Initial setup This answer doesn't attempt to integrate in network configuration tools the commands used below. The following tools, at least, are expected to be usable for this purpose without requiring extra commands: ifupdown2 (not the original ifupdown) but there might be a bug for configuring a PVID ...
How to create a linux vlan aware bridge with ingress packets untagged and egress packets tagged
1,570,710,319,000
I setup a macvtap interface like this: ip link add link eth0 vlan type macvlan mode bridge ip address add 10.0.0.17 dev vlan ip link set dev vlan up ip route flush dev eth0 ip route flush dev vlan ip route add 10.0.0.0/24 dev vlan metric 0 ip route add default via 10.0.0.1 ip link add link eth0 name vtap address xx:xx...
When dhclient was started, it was the only one using the macvtap interface. But when dhclient was sending a packet in order to renew the lease after many hours, it broke macvtap because by that time the guest was also using the interface. And both host and guest cannot use the same interface simultanously. If a totall...
Macvtap connectivity lost after a few hours?
1,570,710,319,000
trying to make local networking experiment, and unable to ping from within the namespaced network. I'm using Fedora 37. Linux dmitry-desktop 6.1.18-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 11 16:09:14 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux I'm getting the following error ➜ sudo ip netns exec netns-test0 ping 1...
I'll limit my references to IPv4 (IPv6 or ARP are also affected, but IPv6 isn't used by OP and no default firewall for ARP exists). Docker relies on and loads the kernel module br_netfilter for proper control of container isolation, even between two containers in the same LAN. This makes Netfilter call IPv4 hooks for ...
packets are filtered via bridge using namespaced network card
1,570,710,319,000
Running into an odd issue where pinging from a VLAN interface specifying the IP address works, but when specifying the interface name it does not. This system is running Rocky Linux 8.5 (4.18.0-348.el8.0.2.x86_64). It has a single network interface plugged in which is set up with 4 bridge interfaces using the old styl...
To have routing tables be adequately selected by routing rules with an interface bound using SO_BINDTODEVICE, rules with the keyword oif should also be used: oif NAME select the outgoing device to match. The outgoing interface is only available for packets originating from local sockets that are bound to a device. E...
Ping from vlan bridge interface fails when specifying interface name, specifying IP address works as expected
1,570,710,319,000
I created VLAN-aware bridge with command and add relevant interfaces: % ip link add br0 type bridge vlan_filtering 1 % ip link set dev eth0 master br0 ... (and repeat this for eth1, eth2, eth3) Now, I want the bridge ports to handle frames with multiple tags, and have the frames stripped off tags and delivered on por...
The bridge self interface, which is the part of the bridge participating in routing, must also be put in the adequate VLAN. To configure the bridge interface rather than one of its port, the additional keyword self is needed. The routing stack (at layer 3) handles IPv4 or IPv6 packets, so expects to receive frames of ...
Linux bridge with trunk ports and self bridge port