I want to delete the first line and ./ from the list that I output with the find command and output the file.

Asked 2 years ago, Updated 2 years ago, 45 views

%find.
.
./ft_magic
./ii
./test1
./.test0
./test3
./test2

linux

2022-09-30 16:21

2 Answers

$find --version
find (GNU findutils) 4.8.0

$ find. - printf '%P\n' | sed1d


2022-09-30 16:21

If it's bash,

shopt-s dotglob; find*

shopt-s dotglob also expands files and directories that begin with * in the current directory.If you don't need it, you don't need it.
To remove shopt-udotglob, use shopt-udotglob.

You asked the same question on teratail.
This is not recommended by teratail, so please take appropriate action.
Help|teratail


2022-09-30 16:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.