Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662
Rep:
How to read long files on the shell?
There is a file named 'grub-install'
As a superuser I wrote the following:
[cat 'grub-install']
I can't read the whole file. It is too long. I can't read the first part of the file. My screen is not long enough to read the first part of the file. How do I read the whole file?
As a matter of fact the file in question is a script.
I am pasting a part of it here.
----------------------------------------------------------
exit 1
fi
if test "x$tmp_part" != x; then
# If a partition is specified, we need to translate it into the
# GRUB's syntax.
case "$host_os" in
linux*)
echo "$tmp_drive" | sed "s%)$%,`expr $tmp_part - 1`)%" ;;
gnu*)
if echo $tmp_part | grep "^s" >/dev/null; then
tmp_pc_slice=`echo $tmp_part \
| sed "s%s\([0-9]*\)[a-g]*$%\1%"`
tmp_drive=`echo "$tmp_drive" \
| sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"`
fi
if echo $tmp_part | grep "[a-g]$" >/dev/null; then
tmp_bsd_partition=`echo "$tmp_part" \
| sed "s%[^a-g]*\([a-g]\)$%\1%"`
tmp_drive=`echo "$tmp_drive" \
| sed "s%)%,$tmp_bsd_partition)%"`
fi
less is more, but more more than more is, so more is less less, so use more less if you want less more
It made me giggle the first time I read it. (The page also give a little description of the pagers less, more, and most. So this post isn't completely random.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.