Is it possible to change tail's default line count?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
When I use tail file
, tail by default prints the last 10 lines.
Is it possible to change that default in the system level?
linux tail
add a comment |Â
up vote
0
down vote
favorite
When I use tail file
, tail by default prints the last 10 lines.
Is it possible to change that default in the system level?
linux tail
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
When I use tail file
, tail by default prints the last 10 lines.
Is it possible to change that default in the system level?
linux tail
When I use tail file
, tail by default prints the last 10 lines.
Is it possible to change that default in the system level?
linux tail
linux tail
asked Oct 3 '17 at 9:40
Itai Ganot
3161412
3161412
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
1
down vote
accepted
No, but you can use alias.
Add to your .bashrc
this string:
alias tails='tail -n 15'
relogin at the server and try to type:
tails file
And you will get the last 15 lines of file
add a comment |Â
up vote
4
down vote
No, the default number of lines produced by tail
(and head
) is mandated by the POSIX standard:
If neither
-c
nor-n
is specified,-n 10
shall be assumed.
To get a different number of lines, use the -n
command line option, or create a shell function:
mytail () tail -n 5 "$@";
or, if you're brave enough,
tail () command tail -n 5 "$@";
add a comment |Â
up vote
0
down vote
To do this you'd need to modify the source code and recompile it. But it looks like a waste of time and effort. Just use
tail -n 42
to output the last 42 lines.
Yea, I know this one... thanks anyways
â Itai Ganot
Oct 3 '17 at 9:45
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
No, but you can use alias.
Add to your .bashrc
this string:
alias tails='tail -n 15'
relogin at the server and try to type:
tails file
And you will get the last 15 lines of file
add a comment |Â
up vote
1
down vote
accepted
No, but you can use alias.
Add to your .bashrc
this string:
alias tails='tail -n 15'
relogin at the server and try to type:
tails file
And you will get the last 15 lines of file
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
No, but you can use alias.
Add to your .bashrc
this string:
alias tails='tail -n 15'
relogin at the server and try to type:
tails file
And you will get the last 15 lines of file
No, but you can use alias.
Add to your .bashrc
this string:
alias tails='tail -n 15'
relogin at the server and try to type:
tails file
And you will get the last 15 lines of file
answered Oct 3 '17 at 10:02
Egor Vasilyev
1,792129
1,792129
add a comment |Â
add a comment |Â
up vote
4
down vote
No, the default number of lines produced by tail
(and head
) is mandated by the POSIX standard:
If neither
-c
nor-n
is specified,-n 10
shall be assumed.
To get a different number of lines, use the -n
command line option, or create a shell function:
mytail () tail -n 5 "$@";
or, if you're brave enough,
tail () command tail -n 5 "$@";
add a comment |Â
up vote
4
down vote
No, the default number of lines produced by tail
(and head
) is mandated by the POSIX standard:
If neither
-c
nor-n
is specified,-n 10
shall be assumed.
To get a different number of lines, use the -n
command line option, or create a shell function:
mytail () tail -n 5 "$@";
or, if you're brave enough,
tail () command tail -n 5 "$@";
add a comment |Â
up vote
4
down vote
up vote
4
down vote
No, the default number of lines produced by tail
(and head
) is mandated by the POSIX standard:
If neither
-c
nor-n
is specified,-n 10
shall be assumed.
To get a different number of lines, use the -n
command line option, or create a shell function:
mytail () tail -n 5 "$@";
or, if you're brave enough,
tail () command tail -n 5 "$@";
No, the default number of lines produced by tail
(and head
) is mandated by the POSIX standard:
If neither
-c
nor-n
is specified,-n 10
shall be assumed.
To get a different number of lines, use the -n
command line option, or create a shell function:
mytail () tail -n 5 "$@";
or, if you're brave enough,
tail () command tail -n 5 "$@";
answered Oct 3 '17 at 9:57
Kusalananda
105k14209326
105k14209326
add a comment |Â
add a comment |Â
up vote
0
down vote
To do this you'd need to modify the source code and recompile it. But it looks like a waste of time and effort. Just use
tail -n 42
to output the last 42 lines.
Yea, I know this one... thanks anyways
â Itai Ganot
Oct 3 '17 at 9:45
add a comment |Â
up vote
0
down vote
To do this you'd need to modify the source code and recompile it. But it looks like a waste of time and effort. Just use
tail -n 42
to output the last 42 lines.
Yea, I know this one... thanks anyways
â Itai Ganot
Oct 3 '17 at 9:45
add a comment |Â
up vote
0
down vote
up vote
0
down vote
To do this you'd need to modify the source code and recompile it. But it looks like a waste of time and effort. Just use
tail -n 42
to output the last 42 lines.
To do this you'd need to modify the source code and recompile it. But it looks like a waste of time and effort. Just use
tail -n 42
to output the last 42 lines.
answered Oct 3 '17 at 9:45
dr01
15.4k114769
15.4k114769
Yea, I know this one... thanks anyways
â Itai Ganot
Oct 3 '17 at 9:45
add a comment |Â
Yea, I know this one... thanks anyways
â Itai Ganot
Oct 3 '17 at 9:45
Yea, I know this one... thanks anyways
â Itai Ganot
Oct 3 '17 at 9:45
Yea, I know this one... thanks anyways
â Itai Ganot
Oct 3 '17 at 9:45
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395795%2fis-it-possible-to-change-tails-default-line-count%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password